Skip to content

Add Ruby as a possible language#513

Merged
aibaars merged 5 commits intomainfrom
aibaars-patch-1
May 26, 2021
Merged

Add Ruby as a possible language#513
aibaars merged 5 commits intomainfrom
aibaars-patch-1

Conversation

@aibaars
Copy link
Contributor

@aibaars aibaars commented May 20, 2021

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Confirm the readme has been updated if necessary.
  • Confirm the changelog has been updated if necessary.

@aibaars aibaars force-pushed the aibaars-patch-1 branch 5 times, most recently from 6e3fa64 to a387486 Compare May 21, 2021 13:01
@aibaars aibaars mentioned this pull request May 21, 2021
1 task
@aibaars aibaars force-pushed the aibaars-patch-1 branch from a387486 to f32c913 Compare May 21, 2021 16:39
@aibaars aibaars force-pushed the aibaars-patch-1 branch 2 times, most recently from c0b46e3 to 0eaec4f Compare May 23, 2021 14:35
src/codeql.ts Outdated
},
}).exec();

return JSON.parse(output);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Catch malformed json errors and rethrow with a meaningful message.

Suggested change
return JSON.parse(output);
try {
return JSON.parse(output);
} catch (e) {
throw new Error("Something meaningful.);
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't that suppress the likely interesting error message of e ? In Java I'd write new Error("Unexpected output from codeql resolve languages", e) . What would be the equivalent in Javascript?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think just construct the message as a string. So like new Error("Unexpected output from codeql resolve languages: " + e.message) and maybe some type checks to make sure that e.message exists.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opted to just write Unexpected output from codeql resolve languages: ${e} . This should include the original error's type and side-steps the problem of a potentially empty message string.

@aibaars aibaars force-pushed the aibaars-patch-1 branch from 0eaec4f to 4f51b8c Compare May 23, 2021 19:14
@aibaars aibaars marked this pull request as ready for review May 23, 2021 19:34
Copy link
Contributor

@aeisenberg aeisenberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're populating the changelog now. Since this is a public-facing feature, could you add an entry. And then it's good to merge. Thanks!

@aibaars aibaars enabled auto-merge May 26, 2021 05:30
@aibaars
Copy link
Contributor Author

aibaars commented May 26, 2021

We're populating the changelog now. Since this is a public-facing feature, could you add an entry. And then it's good to merge. Thanks!

There shouldn't be an entry. This is just for internal tests. CodeQL for Ruby is not available yet.

@aibaars aibaars merged commit 12b2dc6 into main May 26, 2021
@aibaars aibaars deleted the aibaars-patch-1 branch May 26, 2021 05:40
@github-actions github-actions bot mentioned this pull request May 31, 2021
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants