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: create automation for schema updates #111

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

Conversation

wwsean08
Copy link
Contributor

@wwsean08 wwsean08 commented Dec 4, 2022

This CI job automatically opens a PR when a change happens to the graphql schema to hopefully create a quicker turn around time for updates. I've set it to run nightly or manually (by people who have the necessary permissions) via the github UI. I've done some testing in my fork here where I rolled back the master branch a few commits then cherry picked this change just to verify it works as expected. To be tested is the cron scheduling portion however I don't see that being an issue and will be tested within the next 24 hours once it actually hits 2AM UTC.

If you want to create an automation label or something I can add that, or make any other tweaks, but I think this would be a nice improvement to the repo.

Test Cases:

  1. Initial run, which created this PR
  2. Second run to verify that it wouldn't create a duplicate PR which it didn't per the docs
  3. Third run after closing (not merging) the initial PR to make sure it opened a new PR as documented.
  4. Fourth Run after merging the PR created in the third run to verify that no unexpected PRs are created
  5. Fifth Run scheduled run occurred as expected
  6. And another run down the line opened this PR using a scheduled run, [automation] Update with the latest schema changes test-organization-wwsean08/githubv4-test#3

@dmitshur
Copy link
Member

Thanks for suggesting and implementing this, and sorry I didn't get a chance to comment sooner. I've had the idea of doing something like this for some time and I've seen it successfully used in https://github.com/FiloSottile/intermediates for example. However, at this time I'm not sure if there's a way to benefit from it in this project.

The difficulty in going to full automation here is that even though the "regenerate for schema changes" changes are predominantly no more than the output of go generate, I do try to review the changes and pay some attention to improvement opportunities. For example, a8d4a56 added special handling of the SponsorsCountryOrRegionCode enum, 420ad09 for SCIM, and efb6239 for some brand name spelling.

Given I want to look over the change after the trivial go generate step and sometimes apply additional changes, it seems trying to automate this doesn't buy much compared to just doing it manually. I wanted to explain why I'm not prioritizing this opportunity higher at this time, though I may still want to revisit this at some point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants