Skip to content

ci: update generic workflows - #851

Merged
asyncapi-bot merged 1 commit into
masterfrom
bot/update-global-workflow-master-64557e415f2841e194ee06e9e7a7bfbe66ff6fed
Oct 25, 2022
Merged

asyncapi-bot merged 1 commit into
masterfrom
bot/update-global-workflow-master-64557e415f2841e194ee06e9e7a7bfbe66ff6fed

Conversation

@asyncapi-bot

Copy link
Copy Markdown
Contributor

No description provided.

@derberg

derberg commented Oct 14, 2022

Copy link
Copy Markdown
Member

@fmvilas oh crap, now we have a problem with automerging 🤔

@fmvilas

fmvilas commented Oct 14, 2022

Copy link
Copy Markdown
Contributor

Any idea what's happening?

@derberg

derberg commented Oct 17, 2022

Copy link
Copy Markdown
Member

@fmvilas yeah, we now require 3 approvers

@fmvilas

fmvilas commented Oct 17, 2022

Copy link
Copy Markdown
Contributor

Oh damn true 😂 I just added @asyncapi-bot to an exception list. Shall we try here again?

@derberg

derberg commented Oct 17, 2022

Copy link
Copy Markdown
Member

@fmvilas oh, I had no idea we can do such a bypass

@derberg derberg closed this Oct 17, 2022
@derberg derberg reopened this Oct 17, 2022
@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@fmvilas

fmvilas commented Oct 17, 2022

Copy link
Copy Markdown
Contributor

Me neither, I was just playing around with the UI and found it by luck 😅

@derberg

derberg commented Oct 17, 2022

Copy link
Copy Markdown
Member

merging is still blocked 🤔 and any changes in settings should work out of the box, even without closing and opening a PR

@fmvilas

fmvilas commented Oct 17, 2022

Copy link
Copy Markdown
Contributor

Yeah, I see. What I did is to allow asyncapi-bot to bypass having to create a PR. That's a different thing.

So my proposal then is that we don't enforce it but we still commit to the rule "manually". \cc @dalelane @char0n @smoya

@smoya

smoya commented Oct 17, 2022

Copy link
Copy Markdown
Member

So my proposal then is that we don't enforce it but we still commit to the rule "manually". \cc @dalelane @char0n @smoya

I'm fine with that!

@smoya

smoya commented Oct 17, 2022 •

Copy link
Copy Markdown
Member

Yeah, I see. What I did is to allow asyncapi-bot to bypass having to create a PR. That's a different thing.

So my proposal then is that we don't enforce it but we still commit to the rule "manually". \cc @dalelane @char0n @smoya

Oh, but this wouldn't help anyway, right? Automerge won't happen ever unless 2 extra approves happen (2 admins), meaning only "manual" merge by a human (via /rtm or whatever) will let the PR to be merged.

Not ideal at all IMHO. Would it make sense to rather disable this:
2022-10-17 at 15 40 35@2x
Admins could still commit to the rule of 3 approvals for all PRs, but still, those created by the bot will be automerged.
Cons: admins could merge ""accidentally"" PRs without approvals from other admins.

Tradeoffs, tradeoffs everywhere!

@fmvilas

fmvilas commented Oct 17, 2022

Copy link
Copy Markdown
Contributor

@smoya No, I can put it back to only 1 approver required and it would merge with no problem, like everywhere else. But we need to honor the rule of 3 approvers to merge a PR, even though it's not enforced by GitHub. This makes me think now that maybe the /rtm command could be checking for 3 approvers minimum. What do you think, @derberg?

@smoya

smoya commented Oct 17, 2022

Copy link
Copy Markdown
Member

@smoya No, I can put it back to only 1 approver required and it would merge with no problem, like everywhere else. But we need to honor the rule of 3 approvers to merge a PR, even though it's not enforced by GitHub. This makes me think now that maybe the /rtm command could be checking for 3 approvers minimum. What do you think, @derberg?

But afaik by disabling the option I mentioned still GH will enforce that, except for code owners/admins; that's the trade-off.

@derberg

derberg commented Oct 18, 2022

Copy link
Copy Markdown
Member

Yes, the action that we use for merging has a support for MERGE_REQUIRED_APPROVALS that we can set to 3.
2 disadvantages:

  • It would mean we would have to modify the workflow, and it would no longer receive updates from central location in the future
  • This would not be very transparent. People would try to merge with command, but it would not work, without providing context

Easier would be to create additional 2 bot accounts 🤣

@fmvilas

fmvilas commented Oct 18, 2022

Copy link
Copy Markdown
Contributor

Easier would be to create additional 2 bot accounts 🤣

LOL

It would mean we would have to modify the workflow, and it would no longer receive updates from central location in the future

Can't we make the action to take this value from a Github Secret in the repo? It would be like setting an environment variable for this repo only. We can default to 1 if this secret is not found.

This would not be very transparent. People would try to merge with command, but it would not work, without providing context

What about the command shows that it didn't merge because of that reason? I mean, it leaves a comment in the PR.

@derberg

derberg commented Oct 19, 2022

Copy link
Copy Markdown
Member

Can't we make the action to take this value from a Github Secret in the repo? It would be like setting an environment variable for this repo only. We can default to 1 if this secret is not found.

neat workaround! should work, we would have org-wide secret set to 1 and in this repo and others overwritten

What about the command shows that it didn't merge because of that reason? I mean, it leaves a comment in the PR.

yeah, I checked this action. It do not offer proper information in the output. From output we can only learn that merge did not work, but why exactly? failing tests? missing approvals? - this info is not available. Maybe they could enable it, but this will definitely require a contribution.

we could do our own query:

query { 
  repository(owner:"asyncapi", name:"spec") {
    pullRequest(number:851) {
      reviewDecision
    }
  }
}

/*
####Review Decision type####
CHANGES_REQUESTED
Changes have been requested on the pull request.

APPROVED
The pull request has received an approving review.

REVIEW_REQUIRED
A review is required before the pull request can be merged.
*/

for example this PR returns REVIEW_REQUIRED even though bot approved it. So my assumption is, that it is because API knows all 3 approvals are missing. Should be good enough to put a comment "not all approvals are in place"

maybe https://github.com/asyncapi/.github/blob/master/.github/workflows/automerge-for-humans-add-ready-to-merge-or-do-not-merge-label.yml#L29 should just be extended. We already handle "conflicts" there and post comments, so missing approvals should be handled there too I guess.

@fmvilas

fmvilas commented Oct 20, 2022

Copy link
Copy Markdown
Contributor

Alright, so now the question is, who volunteers to do it? 😄 I don't think it should be @derberg because he's quite busy with the conference. Any volunteers?

@derberg

derberg commented Oct 24, 2022

Copy link
Copy Markdown
Member

@fmvilas maybe just open an issue in .github and till then we will just follow kinda written agreement that we will respect minimum of 3 approvers (as we did anyway before onboarding new codeowners)

@fmvilas

fmvilas commented Oct 24, 2022

Copy link
Copy Markdown
Contributor

Done: asyncapi/.github#190

@derberg

derberg commented Oct 25, 2022

Copy link
Copy Markdown
Member

/rtm

1 similar comment
@derberg

derberg commented Oct 25, 2022

Copy link
Copy Markdown
Member

/rtm

@asyncapi-bot
asyncapi-bot merged commit 529cc06 into master Oct 25, 2022
@asyncapi-bot
asyncapi-bot deleted the bot/update-global-workflow-master-64557e415f2841e194ee06e9e7a7bfbe66ff6fed branch October 25, 2022 10:19
@asyncapi-bot

Copy link
Copy Markdown
Contributor Author

🎉 This PR is included in version 3.0.0-next-major-spec.4 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

GreenRover pushed a commit to GreenRover/asyncapi-spec that referenced this pull request Jan 18, 2023
@asyncapi-bot

Copy link
Copy Markdown
Contributor Author

🎉 This PR is included in version 2.6.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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.

5 participants