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 PR check for proposed API changes #24586

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

eleanorjboyd
Copy link
Member

@eleanorjboyd eleanorjboyd commented Dec 11, 2024

Fixes #20939

Add a PR check for proposed API changes without VS Code engine update.

  • Modify package.json to add a new script entry check-proposed-api.
  • Modify .github/workflows/pr-file-check.yml to add a new step to run the check-proposed-api script.
  • Add src/check-proposed-api.js to check for changes in enabledApiProposals and vscode engine version, and fail if enabledApiProposals is modified but vscode engine version is not updated.

For more details, open the Copilot Workspace session.

Fixes #20939

Add a PR check for proposed API changes without VS Code engine update.

* Modify `package.json` to add a new script entry `check-proposed-api`.
* Modify `.github/workflows/pr-file-check.yml` to add a new step to run the `check-proposed-api` script.
* Add `src/check-proposed-api.js` to check for changes in `enabledApiProposals` and `vscode` engine version, and fail if `enabledApiProposals` is modified but `vscode` engine version is not updated.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/microsoft/vscode-python/issues/20939?shareId=XXXX-XXXX-XXXX-XXXX).
@eleanorjboyd eleanorjboyd marked this pull request as draft December 11, 2024 18:24
@eleanorjboyd
Copy link
Member Author

@anthonykim1 what do you think of this? Do you think this is the right approach?


if (JSON.stringify(enabledApiProposals) !== JSON.stringify(originalEnabledApiProposals) &&
vscodeEngineVersion === originalVscodeEngineVersion) {
console.error('Error: `enabledApiProposals` was modified but `vscode` engine version was not updated.');

Choose a reason for hiding this comment

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

Should we throw error to be more explicit? I just dont want this to get hidden in pile of other logs&error.

@anthonykim1
Copy link

I think this is great idea, but how are we defining original package.json from "new package.json"? (is it comparing to the what is in the package.json before changes in a given PR)

I also see

JSON.parse(fs.readFileSync(packageJsonPath + '.original', 'utf8'));

but wondering where does .original contents get updated.

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.

Have a PR check for when a proposed API is added but the VS Code engine isn't changed
2 participants