Skip to content

[ci] automatically update PRs with format fixes #13514

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

Closed
wants to merge 5 commits into from
Closed

Conversation

titusfortner
Copy link
Member

@titusfortner titusfortner commented Jan 25, 2024

Status

Well, now I'm trying to see if I can do something complicated and add a label to rerun tests if there has been an automatic reformatting. It's set up so that it shouldn't end up in a loop. Not sure it is worth going this far, though.

Description

Uses what was done for automatically pinning browsers
Creates a patch file with format changes
In a new job applies the patch file and commits it
pushes the resulting commit back to the PR

Motivation and Context

It's a pain to ask people to fix formatting in their PRs

I introduced formatting bugs in the PR so this should push to the PR. 🤞

There we go, it works!
36ccb88

@titusfortner titusfortner added the B-build Includes scripting, bazel and CI integrations label Jan 25, 2024
@codecov-commenter
Copy link

codecov-commenter commented Jan 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (168c9f5) 58.48% compared to head (1a504ce) 58.48%.
Report is 8 commits behind head on trunk.

❗ Current head 1a504ce differs from pull request most recent head 1aefecb. Consider uploading reports for the commit 1aefecb to get more accurate results

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##            trunk   #13514   +/-   ##
=======================================
  Coverage   58.48%   58.48%           
=======================================
  Files          86       86           
  Lines        5270     5270           
  Branches      220      220           
=======================================
  Hits         3082     3082           
  Misses       1968     1968           
  Partials      220      220           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@CLAassistant
Copy link

CLAassistant commented Jan 26, 2024

CLA assistant check
All committers have signed the CLA.

@titusfortner
Copy link
Member Author

well, this probably works. We'll see once selenium-ci gets off its butt and signs the CLA.

@titusfortner
Copy link
Member Author

Hmm, but I'm expecting this to re-run the tests... I wonder why it does not...

@p0deje
Copy link
Member

p0deje commented Jan 26, 2024

I introduced formatting bugs in the PR so this should push to the PR. 🤞

This would only work on Selenium PRs, not from forks. Is this fine for you?

@titusfortner
Copy link
Member Author

@p0deje why wouldn't it work for forks?

@titusfortner titusfortner force-pushed the format_fixes branch 2 times, most recently from 3dcd7de to ffda703 Compare January 27, 2024 03:55
@p0deje
Copy link
Member

p0deje commented Jan 27, 2024

@p0deje why wouldn't it work for forks?

@titusfortner Because Selenium bot would not have permissions to push to the forked repository, would it?

@titusfortner
Copy link
Member Author

There's a checkbox for
"Allow edits from maintainers" that I believe is checked by default. But I should test something that has it turned off.

@titusfortner
Copy link
Member Author

Hmm, the label to rerun the tests didn't kick off new tests automatically. Does this need to be on trunk first? Maybe this shouldn't be automatic, but run manually by adding the label? I'm going to test this more on my fork...

@titusfortner titusfortner marked this pull request as draft January 27, 2024 16:24
@@ -6,21 +6,95 @@ on:
branches:
- trunk
workflow_dispatch:
issues:
types: [ labeled ]
Copy link
Member

Choose a reason for hiding this comment

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

Will this run when any label is applied?

@titusfortner
Copy link
Member Author

I spent a *lot of time exploring options here, and I'm not happy with anything.

To prevent infinite loops, github won't allow tests to rerun from the same workfkow. I can get it to label and rerun, but the tests don't get attached to the commit that was just made in the UI. Either way, the PR shows zero checks in the checks tab (what is in this PR)

I'm out of ideas and tired of working on this, so I'm giving up. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B-build Includes scripting, bazel and CI integrations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants