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

feat: add validity check to Electron Archaeologist runs #42

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

alicelovescake
Copy link
Member

@alicelovescake alicelovescake commented May 12, 2024

This PR fixes #41 :

  • Adds a new function getCheckStatusItems to handle the check status based on the presence of changes and semantic versioning labels in pull requests.
  • Created unit tests to validate the behavior of the getCheckStatusItems function under various conditions.
  • Added a bunch of jest related packages and config to enable test running in this repo

Note: Not 100% CI configs are correct, mostly copied over from Trop

@alicelovescake alicelovescake requested a review from a team as a code owner May 12, 2024 22:25
@codebytere
Copy link
Member

@alicelovescake this repo's circleci config is used for the TypeScript comparison - it doesn't run tests at the moment. Potentially it might be easier to extract that aspect to a GitHub Action like the lint job?

@alicelovescake alicelovescake force-pushed the alice-add-valid-check branch from 75fd6ba to 3dfe6df Compare May 14, 2024 21:48
@alicelovescake
Copy link
Member Author

@alicelovescake this repo's circleci config is used for the TypeScript comparison - it doesn't run tests at the moment. Potentially it might be easier to extract that aspect to a GitHub Action like the lint job?

Thanks for the pointer! Yeah I wasn't confident whether to put the test in the circle ci or github. Updated PR with new github workflow.

Comment on lines +23 to +25
conclusion: CheckRunStatus.FAILURE,
title: 'Label Mismatch with Changes Detected',
summary: "Changes detected despite the presence of 'semver/none' label. ",
Copy link
Member

Choose a reason for hiding this comment

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

There needs to be a way of overriding this

Comment on lines +13 to +15
conclusion: CheckRunStatus.FAILURE,
title: 'Label Mismatch with No Changes',
summary: "No changes detected despite the presence of 'semver/minor' or 'semver/major' labels.",
Copy link
Member

Choose a reason for hiding this comment

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

There needs to be a way of overriding this, something like like our fast-track or skip-backport-check labels to bypass trop / cation checks.

This isn't 100% provably correct, for instance:

  • You can make a semver/major change with 0 API surface changing, for instance enabling a feature by default (Cooke Encryption comes to mind as a semver/major with 0 API)
  • You can make a semver/none change that modifies the API surface. For instance docs fixes commonly "modify" the electron.d.ts file but don't actually change the API surface. So unless this check gets smarter around diffing actual API surface rather than just the electron.d.ts file we need a way to say "in this case we're all good"

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for pointing out the edge cases that I haven't considered!

I can add a new label that's skip-type-diff-check but do you think it adds unnecessary complexity to the process? After all, the primary purpose of these checks is to provide informational cues to users.

What if for expected valid changes, we set the status to CheckRunStatus.SUCCESS and for suspected invalid changes, we set the status to CheckRunStatus.NEUTRAL with a summary that gives a warning that unexpected changes exist but feel free to skip if it's intentional.

This way, it serves the purpose of providing information without adding process overhead. If we feel like the override tag is better, happy to add 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.

Fail Check if Changes and PR Labeled semver/none
3 participants