Skip to content

[v2][Feat] Add the check-generate workflow can work in local runner for the PR from fork repo (#6845)#7040

Closed
SZL741023 wants to merge 15 commits intoflyteorg:v2from
SZL741023:v2_git_workflows_dev
Closed

[v2][Feat] Add the check-generate workflow can work in local runner for the PR from fork repo (#6845)#7040
SZL741023 wants to merge 15 commits intoflyteorg:v2from
SZL741023:v2_git_workflows_dev

Conversation

@SZL741023
Copy link
Copy Markdown
Contributor

@SZL741023 SZL741023 commented Mar 18, 2026

Tracking issue

Related to: (#6845)
Original PR: (#6952)

Why are the changes needed?

In original work flow, if files gen.Dockerfile and build-ci-image.yml have been changed, the action for build ci image will be trigger. The action for check generation will be exercise after a new ci image is built.

If the PR from fork repo, the ci image should not be rebuild and the check generate will be run in local runner.

What changes were proposed in this pull request?

build-ci-image.yml add the condition to check the PR is from the same repo or fork repo.
If PR is from fork repo, build ci image will be skip.

check-generation.yml add the condition to check the PR is from fork repo or not, and add needs: [check-generate-conatiner, check-generate-local] to call these workflows with the check fork repo condition and monitor these workflow will be failure or not.
Add two workflows files check-generate-container.yml and check-generate-local.yml file and trigger by workflow call.
One does check generate in container, the other one does check generate in local runner.
Add the extract() function in check-generate-local.yml to extract the tool versions from gen.Dockerfile to ensure that the correct version information is used.

How was this patch tested?

Ensure the PR from fork repo will not trigger the action for build ci image, and check generation will be run in locally runner.

Labels

Please add one or more of the following labels to categorize your PR:

  • added: For new features.
  • changed: For changes in existing functionality.
  • deprecated: For soon-to-be-removed features.
  • removed: For features being removed.
  • fixed: For any bug fixed.
  • security: In case of vulnerabilities

This is important to improve the readability of release notes.

Setup process

Screenshots

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

Docs link

Adjust check-generate workflow that will call other workflows and check
other workflows will be failure or not
Separate original check-generate workflow to
check-generate-container.yml and rename to check-generate-container
Add new workflow file check-generate-local.yml for the PR from fork repo

Signed-off-by: SZL741023 <[email protected]>
If the PR from fork repo, don't to rebuild the ci image

Signed-off-by: SZL741023 <[email protected]>
Copy link
Copy Markdown
Member

@machichima machichima left a comment

Choose a reason for hiding this comment

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

LGTM! Just a small nit. Also, please fix the merge conflict
Thank you!

Comment thread .github/workflows/build-ci-image.yml Outdated
echo "buf=$(extract BUF_VERSION)" >> $GITHUB_OUTPUT
echo "mockery=$(extract MOCKERY_VERSION)" >> $GITHUB_OUTPUT

check-generate:
Copy link
Copy Markdown
Member

@machichima machichima Apr 24, 2026

Choose a reason for hiding this comment

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

I think we only need this check-generate in both check-generate-local and check-generate-container.

For others like check-go-tidy and check-mocks we can move to check-generate? So we will not see CI shows:

Image

I would expect seeing only one Check Generated Files / check-generate-local

Copy link
Copy Markdown
Contributor Author

@SZL741023 SZL741023 Apr 25, 2026

Choose a reason for hiding this comment

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

Both CI job check-go-tidy and check-mock also need to use the same container, so they also need to be run separately in the container and local environments.
But as per discussion, we got the new solution, if the pr from fork, build a new image to github action storage and then use it to run check-generate , check-go-tidy , check-mock
I will adjust it later.

machichima
machichima previously approved these changes Apr 24, 2026
Copy link
Copy Markdown
Member

@machichima machichima left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you!
cc @pingsutw for final pass

Add the job to build image for fork PR.
According the PR to choice local image or ghcr.io image.

Signed-off-by: SZL741023 <[email protected]>
Merge branch 'v2' of https://github.com/flyteorg/flyte into
v2_git_workflows_dev

Signed-off-by: SZL741023 <[email protected]>
Signed-off-by: SZL741023 <[email protected]>
@SZL741023
Copy link
Copy Markdown
Contributor Author

Adjust the workflow, if the PR is from fork repo, it will build a local image to github storage, then do check-generate, check-go-tidy, check-mocks. Otherwise will use the image in ghcr.io.
Cause of the command container: can only pull the image from Docker Hub or ghcr.io, so in our case, it can't pull the image built locally. So use docker run to replace container: to allow the same ci job(check-generate, check-go-tidy, check-mocks) can be reused.

… fork PR

Allow the fork PR that modified the gen.Dockerfile can push the new
image to ghcr.io.

Signed-off-by: SZL741023 <[email protected]>
@SZL741023 SZL741023 changed the base branch from v2 to main May 1, 2026 02:41
@SZL741023 SZL741023 dismissed machichima’s stale review May 1, 2026 02:41

The base branch was changed.

@SZL741023 SZL741023 changed the base branch from main to v2 May 2, 2026 00:16
@SZL741023
Copy link
Copy Markdown
Contributor Author

New pr for this issue is #7336

@SZL741023 SZL741023 closed this May 3, 2026
@SZL741023 SZL741023 deleted the v2_git_workflows_dev branch May 3, 2026 15:37
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.

2 participants