Skip to content

Simpler checkers#478

Merged
javiertoledo merged 1 commit intomasterfrom
simpler-checkers
Oct 29, 2020
Merged

Simpler checkers#478
javiertoledo merged 1 commit intomasterfrom
simpler-checkers

Conversation

@javiertoledo
Copy link
Member

@javiertoledo javiertoledo commented Oct 27, 2020

Description

Check Runs have been working unreliably for a while now, and they were becoming harder and harder to manage, so I've reworked the corresponding Github actions to use a simpler/standard workflow. The intention of this PR is to show how this implementation works and reach an agreement with the team about the proposed workflow with the "lock" option. I locked and unlocked the PR to trigger the integration actions. Some of the tests will likely fail because this branch doesn't include the fixes from #476

Changes

  • Linter and Tests are run on every push, nothing changes here from a functional perspective.
  • Integration tests will stop responding to special comments like integration: all. Instead of that, the integration tests are run when the PR is locked.

Why I think that this change makes sense

Locking a PR disables new comments (still allow owner comments) and means that the conversation is over. When you lock a PR you can set a reason, and this reason can be "Resolved", so this makes sense from the workflow POV. We can interpret that locking a PR as "Resolved" means that is time for integration and merge. We can always "unlock" the PR to fix issues if the tests fail and lock it again when we're done to run them again. I think that this could be an elegant solution to automate the integration tests in an easier way, but I'm totally open to alternate ideas. It is very convenient that the locked event is a PR event because that allows us to remove the Github check runs management from the jobs, where I suspect we introduced a bug that was making these tests misbehave.

Checks

  • Project Builds
  • Project passes tests and checks
  • Updated documentation accordingly

Additional info

You can find the "Lock conversation" link in the bottom of the right side panel:
Screen Shot 2020-10-27 at 20 11 17

That link opens a modal where you can set the reason:
Screen Shot 2020-10-27 at 20 11 44

Everything is looking good so far. If you remember how this was working in previous commits, clicking on an action details sent you to the wrong commit actions and other weird stuff. All of these issues seem to be resolved here:
Screen Shot 2020-10-27 at 20 56 42

@javiertoledo javiertoledo self-assigned this Oct 27, 2020
@boostercloud boostercloud locked as resolved and limited conversation to collaborators Oct 27, 2020
@boostercloud boostercloud unlocked this conversation Oct 27, 2020
DESTINATION_BRANCH: 'master-mirror'
SSH_PRIVATE_KEY: ${{ secrets.BOT_SSH_PRIVATE_KEY }}
with:
args: $SOURCE_REPO $SOURCE_BRANCH $DESTINATION_REPO $DESTINATION_BRANCH
Copy link
Member Author

Choose a reason for hiding this comment

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

I deleted this script because we won't need it anymore

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: npx lerna bootstrap
- run: npx lerna run integration/local --stream No newline at end of file
Copy link
Member Author

Choose a reason for hiding this comment

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

Just like that...

Copy link

@NickSeagull NickSeagull left a comment

Choose a reason for hiding this comment

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

Ok, this simplifies a lot, but also it makes me worry about the fact that it locks conversation without being able to add more comments. Although I see that this would be the case for when we are about to merge it.

We should unlock the PR once the tests finish, so people in the future can comment as well, even if it is closed/merged. Maybe this can be automated?

It might be a good idea to add an automated comment that says something like

"This PR was locked to run the integration tests, and will be unlocked afterwards"

@alvaroloes
Copy link
Contributor

Ideally, we should force integration tests to run before you are able to merge. This is not true right now (we didn't find a way) but just wanted to say the ideal scenario.

For me, it seems weird to lock a PR to execute integration tests, it is not obvious. I agree it can be learned if it simplifies things.
Questions and other points:

  • When I lock the PR, are the checks shown in the PR?
  • Inf integration tests fail, Can I still merge the PR? Ideally, this would be "no"
  • It might be a bit cumbersome to lock-unlock, lock-unlock when you are fixing local tests.

@javiertoledo
Copy link
Member Author

javiertoledo commented Oct 28, 2020

When I lock the PR, are the checks shown in the PR?

Yes, I ran them locking the conversation in this PR

If integration tests fail, Can I still merge the PR? Ideally, this would be "no"

Only if you're an admin, the checks are shown along with lint and tests, and failing checks will put that nice big red warning before merging

It might be a bit cumbersome to lock-unlock, lock-unlock when you are fixing local tests.

It definitively is, but I can't imagine a better way. Ideally, there should be some kind of "before merge" hook, but we don't have that yet.

I know that this is not ideal, but using comments isn't either, and using a pull_request hook makes things way simpler and stable. I went through all the available events and locked was the least "invasive". All the other hooks happen too early or too late, or can't be easily managed by hand. Any other ideas?

BTW, only the repository committers will have access to merges, so we only need ourselves to adopt "the process" and make sure we pull the trigger before happily merging :trollface:

Copy link
Contributor

@alvaroloes alvaroloes left a comment

Choose a reason for hiding this comment

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

What a massive simplification. Thanks for answering! Now I'm all in with this solution.

@javiertoledo javiertoledo merged commit 9de2a03 into master Oct 29, 2020
@javiertoledo javiertoledo deleted the simpler-checkers branch October 29, 2020 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants