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

Add a guard job to prevent accidental auto-merging of PRs when cross-version tests fail #10210

Merged
merged 20 commits into from Nov 15, 2023

Conversation

TomeHirata
Copy link
Contributor

@TomeHirata TomeHirata commented Oct 29, 2023

🛠 DevTools 🛠

Open in GitHub Codespaces

Install mlflow from this PR

pip install git+https://github.com/mlflow/mlflow.git@refs/pull/10210/merge

Checkout with GitHub CLI

gh pr checkout 10210

Related Issues/PRs

Resolve #10069

What changes are proposed in this pull request?

Cross-version tests can't be marked as required because they get triggered conditionally.

How is this PR tested?

Does this PR require documentation update?

  • No. You can skip the rest of this section.
  • Yes. I've updated:
    • Examples
    • API references
    • Instructions

Release Notes

Is this a user-facing change?

  • No. You can skip the rest of this section.
  • Yes. Give a description of this change to be included in the release notes for MLflow users.

What component(s), interfaces, languages, and integrations does this PR affect?

Components

  • area/artifacts: Artifact stores and artifact logging
  • area/build: Build and test infrastructure for MLflow
  • area/docs: MLflow documentation pages
  • area/examples: Example code
  • area/gateway: AI Gateway service, Gateway client APIs, third-party Gateway integrations
  • area/model-registry: Model Registry service, APIs, and the fluent client calls for Model Registry
  • area/models: MLmodel format, model serialization/deserialization, flavors
  • area/recipes: Recipes, Recipe APIs, Recipe configs, Recipe Templates
  • area/projects: MLproject format, project running backends
  • area/scoring: MLflow Model server, model deployment tools, Spark UDFs
  • area/server-infra: MLflow Tracking server backend
  • area/tracking: Tracking Service, tracking client APIs, autologging

Interface

  • area/uiux: Front-end, user experience, plotting, JavaScript, JavaScript dev server
  • area/docker: Docker use across MLflow's components, such as MLflow Projects and MLflow Models
  • area/sqlalchemy: Use of SQLAlchemy in the Tracking Service or Model Registry
  • area/windows: Windows support

Language

  • language/r: R APIs and clients
  • language/java: Java APIs and clients
  • language/new: Proposals for new client languages

Integrations

  • integrations/azure: Azure and Azure ML integrations
  • integrations/sagemaker: SageMaker integrations
  • integrations/databricks: Databricks integrations

How should the PR be classified in the release notes? Choose one:

  • rn/none - No description will be included. The PR will be mentioned only by the PR number in the "Small Bugfixes and Documentation Updates" section
  • rn/breaking-change - The PR will be mentioned in the "Breaking Changes" section
  • rn/feature - A new user-facing feature worth mentioning in the release notes
  • rn/bug-fix - A user-facing bug fix worth mentioning in the release notes
  • rn/documentation - A user-facing documentation change worth mentioning in the release notes

Signed-off-by: TomeHirata <tomu.hirata@gmail.com>
@github-actions
Copy link

github-actions bot commented Oct 29, 2023

Documentation preview for a1cdac3 will be available here when this CircleCI job completes successfully.

More info

@github-actions github-actions bot added the rn/none List under Small Changes in Changelogs. label Oct 29, 2023
@TomeHirata
Copy link
Contributor Author

Question: should we add an instruction about the auto-merge label to https://github.com/mlflow/mlflow/blob/master/CONTRIBUTING.md?

@harupy
Copy link
Member

harupy commented Oct 30, 2023

@TomeHirata I found a better and simpler solution to solve the original problem. Can we close this and revisit later in the future if necessary?

--- EDIT ---

The solution may not work. Let me think.

@harupy
Copy link
Member

harupy commented Oct 30, 2023

Question: should we add an instruction about the auto-merge label to https://github.com/mlflow/mlflow/blob/master/CONTRIBUTING.md?

Yes, we should, but we add it later as a follow-up after we confirm everything works as expected.

Signed-off-by: TomeHirata <tomu.hirata@gmail.com>
Signed-off-by: TomeHirata <tomu.hirata@gmail.com>
Signed-off-by: TomeHirata <tomu.hirata@gmail.com>
Signed-off-by: TomeHirata <tomu.hirata@gmail.com>
Signed-off-by: harupy <hkawamura0130@gmail.com>
Signed-off-by: harupy <hkawamura0130@gmail.com>
@TomeHirata
Copy link
Contributor Author

@harupy I saw your PR was correctly merged after approving it. Please let me know if any further tests/modifications are needed. 🙏

@harupy
Copy link
Member

harupy commented Nov 7, 2023

@TomeHirata I found a few more issues in the current implementation.

  1. It's possible that a single commit ref have multiple check runs for a single job. For example, two runs for the post-merge workflow (canceled one + succeded one).
  2. CircleCI checks are not check runs. They are commit statues. We need to use a different GitHub API.

@TomeHirata
Copy link
Contributor Author

TomeHirata commented Nov 7, 2023

That's a good point. I'll work on #2. Regarding the first issue of multiple checks, could you elaborate on why this will become an issue? Do we need to worry about the status of post-merge workflows before merging the PR?

@harupy
Copy link
Member

harupy commented Nov 8, 2023

could you elaborate on why this will become an issue? Do we need to worry about the status of post-merge workflows before merging the PR?

Yes, this isn't specific to the post-merge. The same thing can happen to other jobs. Imagine the following scenario:

  1. Make a commit
  2. Push the commit
  3. Make another commit
  4. Push it
  5. Revert the second commit locally
  6. Do a force-push

After this, the first commit two runs for each job. The first run could be canceled. If so, that would block automerge because cancled is not skipped or success.

@TomeHirata
Copy link
Contributor Author

Thank you for the explanation, yes it is possible. Then, should we group the check runs by a unique check identifier (need to figure out) and check the status of the latest run?

@harupy
Copy link
Member

harupy commented Nov 9, 2023

Yes, that should work.

@TomeHirata
Copy link
Contributor Author

@harupy I've updated the logic in 8bc132a. Could you take a look? Also, can I ask if there is any environment to verify the commit status check easily?

@harupy
Copy link
Member

harupy commented Nov 10, 2023

Thanks for the updates! Can we manually create a commit status using https://docs.github.com/en/rest/commits/statuses?apiVersion=2022-11-28#create-a-commit-status?

@harupy
Copy link
Member

harupy commented Nov 13, 2023

@TomeHirata After some thought, I think adding a guard job is simpler and much safer than the current approach. The guard job does the following:

  1. Always runs on pull request.
  2. Is marked as required.
  3. Wait for other jobs to succeed.

Example: #10368

I can push updates to this PR if this sounds good to you.

@TomeHirata
Copy link
Contributor Author

That is similar to what I was thinking when I asked this question. I agree that having a synchronous job triggered per PR is better to work with. Is it correct that you plan to make the job required in the Github setting?

@harupy
Copy link
Member

harupy commented Nov 14, 2023

Is it correct that you plan to make the job required in the Github setting?

Yes, that's the plan.

@TomeHirata
Copy link
Contributor Author

Sure, then this also sounds to me. Please feel free to push changes to the PR.

Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>
Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>
Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>
@harupy harupy changed the title Add auto-merge workflow Add a guard job to prevent accidental auto-merging of PRs when cross-version tests fail Nov 14, 2023
@harupy harupy mentioned this pull request Nov 14, 2023
37 tasks
Copy link
Member

@harupy harupy left a comment

Choose a reason for hiding this comment

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

re-LGTM!

Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>
@harupy
Copy link
Member

harupy commented Nov 15, 2023

@TomeHirata Thanks for the patience! I underestimated the complexity of PR merge. Glad we settled on a safe and simple solution.

@harupy harupy merged commit 3fc3472 into mlflow:master Nov 15, 2023
35 checks passed
@harupy
Copy link
Member

harupy commented Nov 16, 2023

@TomeHirata Can we resume the work on #9939?

@TomeHirata
Copy link
Contributor Author

TomeHirata commented Nov 16, 2023

@harupy Yes, what will be the next step of #9939? Should we start from the designing?
Also, would you mind reviewing #10266?

@harupy
Copy link
Member

harupy commented Nov 17, 2023

@TomeHirata Thanks for the reply!

Yes, what will be the next step of #9939? Should we start from the designing?

#9939 is actually like a design (for more details, please take a look at the attached PDF). We need to add unit tests and docs.

Design doc: Copy of [2023-11-18] One-Decision Doc_ Rate limits for OSS AI Gateway.pdf

Also, would you mind reviewing #10266?

Left some comments, thanks for working on this!

@TomeHirata
Copy link
Contributor Author

Thank you for the reply, let me take a look at the doc and the current state of the PR.

KonakanchiSwathi pushed a commit to KonakanchiSwathi/mlflow that referenced this pull request Nov 29, 2023
…version tests fail (mlflow#10210)

Signed-off-by: TomeHirata <tomu.hirata@gmail.com>
Signed-off-by: harupy <hkawamura0130@gmail.com>
Signed-off-by: TomuHirata <tomu.hirata@gmail.com>
Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>
Co-authored-by: harupy <hkawamura0130@gmail.com>
Co-authored-by: harupy <17039389+harupy@users.noreply.github.com>
Signed-off-by: swathi <konakanchi.swathi@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rn/none List under Small Changes in Changelogs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automerge action
2 participants