Skip to content
This repository was archived by the owner on Jan 30, 2026. It is now read-only.

Automate checking for Pyxis schema updates#31

Merged
komish merged 1 commit into
opdev:mainfrom
caxu-rh:pyxis-schema-actions
Jun 17, 2025
Merged

Automate checking for Pyxis schema updates#31
komish merged 1 commit into
opdev:mainfrom
caxu-rh:pyxis-schema-actions

Conversation

@caxu-rh
Copy link
Copy Markdown
Contributor

@caxu-rh caxu-rh commented Jun 16, 2025

This change introduces:

  • A new target in Makefile, ci.generate which wraps around the existing generate target. Works similarly to other ci.* tasks: do some operation on the codebase and check if there is a diff.
  • A new GitHub Actions workflow which checks if there is a diff in schema.gql or generated.go, after running make ci.generate. If there is a diff in either of those files, it is committed into a new branch, pushed, and a PR is opened.
    • This workflow is currently only triggered via workflow_dispatch, i.e. manually. I figured it would be best to get a bit more confidence in this process (and decide on update frequency) before further adjusting it to run on a schedule.
    • The workflow also checks if there are any PRs open with a schema-update label present. We can adjust the exact naming of the label to look for as needed.
      • If at least one such PR is open, the check and/or update will not continue (to avoid PR spam).
      • Further work is needed to automatically label PRs which modify schema.gql or generated.go. My thought was to put it in the existing pull request workflow, to catch both manual and automated updates of these files. However, if manual updates of these files is not a concern, we can also just add the labeling logic into this workflow.

To test this workflow, I checked out a separate branch on my own fork, pyxis-schema-update-test, and reset it backwards to be right before #29 was merged, then added these changes on top.

I then tried (1) manually running the workflow (no pull request for the update exists yet, and there is a diff that should be committed/pushed) which created a PR (which I manually labeled), (2) running the workflow again without merging the newly created PR (this run exits early to avoid creating a duplicate PR), and then after merging, (3) running the workflow again (there is no longer a diff, so the check happens but no PR is created).

@exe-prow-github-app exe-prow-github-app Bot requested a review from komish June 16, 2025 20:38
Comment thread .github/workflows/schema-update.yaml Outdated
@caxu-rh caxu-rh force-pushed the pyxis-schema-actions branch from bbdceb7 to bc88b7e Compare June 17, 2025 17:01
Comment thread .github/workflows/schema-update.yaml
Comment thread .github/workflows/schema-update.yaml Outdated
Signed-off-by: Caleb Xu <caxu@redhat.com>
@caxu-rh caxu-rh force-pushed the pyxis-schema-actions branch from bc88b7e to 94be0db Compare June 17, 2025 18:15
Copy link
Copy Markdown
Collaborator

@komish komish left a comment

Choose a reason for hiding this comment

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

/lgtm

@exe-prow-github-app exe-prow-github-app Bot added the lgtm Indicates that a PR is ready to be merged. label Jun 17, 2025
@exe-prow-github-app
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: caxu-rh, komish

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@exe-prow-github-app exe-prow-github-app Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 17, 2025
@komish komish merged commit 15e6920 into opdev:main Jun 17, 2025
2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants