Skip to content

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.

@eleanorjboyd
Copy link
Member Author

closing as this problem doesn't face us enough to use workers on it

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

3 participants