Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add script and VSCode task for creating change notes #18086

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tausbn
Copy link
Contributor

@tausbn tausbn commented Nov 22, 2024

Adds a VSCode Task (accessible from the "Run Task" menu) for creating change notes, prompting the user for the language, name, and category of the change.

The language options presented are based on the existing occurrences of change-notes folders in the repo. There are more such files (in particular every shared library has a change-notes directory), but it seemed to me that the language change notes are the ones that are most common, and so in an effort to not clutter the list too much, I only included the languages.

The selection of categories is based on existing usage -- more specifically the result of grepping for occurrences of '^category: ' in the repo. It's possible there are more change categories that could be added.

Hopefully this should make it more convenient to create change notes from within VSCode.

Pull Request checklist

All query authors

Internal query authors only

  • Autofixes generated based on these changes are valid, only needed if this PR makes significant changes to .ql, .qll, or .qhelp files. See the documentation (internal access required).
  • Changes are validated at scale (internal access required).
  • Adding a new query? Consider also adding the query to autofix.

Adds a VSCode Task (accessible from the "Run Task" menu) for creating
change notes, prompting the user for the language, name, and category of
the change.

The language options presented are based on the existing occurrences of
`change-notes` folders in the repo. There are more such files (in
particular every shared library has a `change-notes` directory), but it
seemed to me that the language change notes are the ones that are most
common, and so in an effort to not clutter the list too much, I only
included the languages.

The selection of categories is based on existing usage -- more
specifically the result of grepping for occurrences of '^category: ' in
the repo. It's possible there are more change categories that could be
added.

Hopefully this should make it more convenient to create change notes
from within VSCode.
@tausbn tausbn added the no-change-note-required This PR does not need a change note label Nov 22, 2024
@tausbn tausbn marked this pull request as ready for review November 22, 2024 22:37
@tausbn tausbn requested a review from Copilot November 22, 2024 22:45

Choose a reason for hiding this comment

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

Copilot reviewed 1 out of 2 changed files in this pull request and generated no suggestions.

Files not reviewed (1)
  • .vscode/tasks.json: Language not supported
Comments skipped due to low confidence (1)

misc/scripts/create-change-note.py:31

  • The error message could be more informative. Consider changing it to: 'Output directory {language}/ql/lib/change-notes does not exist. Please ensure the directory path is correct.'
print(f"Output directory {language}/ql/lib/change-notes does not exist")

Tip: If you use Visual Studio Code, you can request a review from Copilot before you push from the "Source Control" tab. Learn more

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.

Nice. Looks reasonable to me.

Comment on lines +87 to +91
"minorAnalysis",
"newQuery",
"fix",
"majorAnalysis",
"breaking",
Copy link
Contributor

Choose a reason for hiding this comment

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

Note that the categories differ between library changes and query changes: https://github.com/github/codeql/blob/main/docs/change-notes.md

# - The name of the change note (in kebab-case)
# - The category of the change.

# The change note will be created in the `{language}/ql/lib/change-notes` directory.
Copy link
Contributor

Choose a reason for hiding this comment

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

What about query changes? Which should go in {language}/ql/src/change-notes?

Copy link
Contributor

Choose a reason for hiding this comment

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

☝️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-change-note-required This PR does not need a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants