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

ci: fixes bot workflow and comment update #3229

Merged
merged 10 commits into from
Nov 28, 2024

Conversation

aeddi
Copy link
Contributor

@aeddi aeddi commented Nov 28, 2024

This PR should (normally) fix the issues with the bot on this repo.
In addition to the fixes, I also replaced the old config with a config that has much simpler rules while we decide what to add later on, once we've verified that everything is working properly.

Here is the current config, If nothing seems off to you, we can merge it as it is then improve it incrementaly.

auto := []automaticCheck{
  {
    description: "Maintainers must be able to edit this pull request",
    ifC:         c.Always(),
    thenR:       r.MaintainerCanModify(),
  },
  {
    description: "The pull request head branch must be up-to-date with its base",
    ifC:         c.Always(),
    thenR:       r.UpToDateWith(gh, r.PR_BASE),
  },
  {
    description: "Changes to 'docs' folder must be reviewed/authored by at least one devrel and one tech-staff",
    ifC:         c.FileChanged(gh, "^docs/"),
    thenR: r.Or(
      r.And(
        r.AuthorInTeam(gh, "devrels"),
        r.ReviewByTeamMembers(gh, "tech-staff", 1),
      ),
      r.And(
        r.AuthorInTeam(gh, "tech-staff"),
        r.ReviewByTeamMembers(gh, "devrels", 1),
      ),
    ),
  },
}

manual := []manualCheck{
  {
    description: "The pull request description provides enough details",
    ifC:         c.Not(c.AuthorInTeam(gh, "core-contributors")),
    teams:       Teams{"core-contributors"},
  },
  {
    description: "Determine if infra needs to be updated before merging",
    ifC: c.And(
      c.BaseBranch("master"),
      c.Or(
        c.FileChanged(gh, `Dockerfile`),
        c.FileChanged(gh, `^misc/deployments`),
        c.FileChanged(gh, `^misc/docker-`),
        c.FileChanged(gh, `^.github/workflows/releaser.*\.yml$`),
        c.FileChanged(gh, `^.github/workflows/portal-loop\.yml$`),
      ),
    ),
    teams: Teams{"devops"},
  },
}
Contributors' checklist...
  • Added new tests, or not needed, or not feasible
  • Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory
  • Updated the official documentation or not needed
  • No breaking changes were made, or a BREAKING CHANGE: xxx message was included in the description
  • Added references to related issues and PRs
  • Provided any useful hints for running manual tests

Copy link

codecov bot commented Nov 28, 2024

@aeddi aeddi changed the title test: fix assignee and label tests ci: fixes bot workflow and comment update Nov 28, 2024
Copy link
Member

@zivkovicmilos zivkovicmilos left a comment

Choose a reason for hiding this comment

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

Config looks good 💯

contribs/github-bot/internal/requirements/label_test.go Outdated Show resolved Hide resolved
contribs/github-bot/internal/requirements/label_test.go Outdated Show resolved Hide resolved
@Kouteki Kouteki added the in focus Core team is prioritizing this work label Nov 28, 2024
.github/workflows/bot.yml Show resolved Hide resolved
@thehowl thehowl merged commit 97b2159 into gnolang:master Nov 28, 2024
102 of 106 checks passed
@Kouteki Kouteki removed the in focus Core team is prioritizing this work label Nov 29, 2024
@gnolang gnolang deleted a comment from Gno2D2 Dec 2, 2024
@aeddi aeddi mentioned this pull request Dec 5, 2024
6 tasks
thehowl added a commit that referenced this pull request Dec 7, 2024
Related to
#3229 (comment)

This PR replaces most fixed versions of Go in the CI workflows with
retrieving the version from the relevant go.mod file.

For workflows that do not have an associated go.mod file, the go.mod
file at the root of the repository is used. All `*_template.yml`
workflows seem designed to use a fixed version of go and do not allow
passing a go.mod file to the `setup-go` action. Achieving this would
require a more significant refactor.

<details><summary>Contributors' checklist...</summary>

- [ ] Added new tests, or not needed, or not feasible
- [ ] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [ ] Updated the official documentation or not needed
- [ ] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [ ] Added references to related issues and PRs
- [ ] Provided any useful hints for running manual tests
</details>

Co-authored-by: Morgan <[email protected]>
omarsy pushed a commit to TERITORI/gno that referenced this pull request Dec 7, 2024
Related to
gnolang#3229 (comment)

This PR replaces most fixed versions of Go in the CI workflows with
retrieving the version from the relevant go.mod file.

For workflows that do not have an associated go.mod file, the go.mod
file at the root of the repository is used. All `*_template.yml`
workflows seem designed to use a fixed version of go and do not allow
passing a go.mod file to the `setup-go` action. Achieving this would
require a more significant refactor.

<details><summary>Contributors' checklist...</summary>

- [ ] Added new tests, or not needed, or not feasible
- [ ] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [ ] Updated the official documentation or not needed
- [ ] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [ ] Added references to related issues and PRs
- [ ] Provided any useful hints for running manual tests
</details>

Co-authored-by: Morgan <[email protected]>
Villaquiranm pushed a commit to Villaquiranm/gno that referenced this pull request Dec 9, 2024
Related to
gnolang#3229 (comment)

This PR replaces most fixed versions of Go in the CI workflows with
retrieving the version from the relevant go.mod file.

For workflows that do not have an associated go.mod file, the go.mod
file at the root of the repository is used. All `*_template.yml`
workflows seem designed to use a fixed version of go and do not allow
passing a go.mod file to the `setup-go` action. Achieving this would
require a more significant refactor.

<details><summary>Contributors' checklist...</summary>

- [ ] Added new tests, or not needed, or not feasible
- [ ] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [ ] Updated the official documentation or not needed
- [ ] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [ ] Added references to related issues and PRs
- [ ] Provided any useful hints for running manual tests
</details>

Co-authored-by: Morgan <[email protected]>
r3v4s pushed a commit to gnoswap-labs/gno that referenced this pull request Dec 10, 2024
This PR should (normally) fix the issues with the bot on this repo. 
In addition to the fixes, I also replaced the old config with a config
that has much simpler rules while we decide what to add later on, once
we've verified that everything is working properly.

Here is the current config, If nothing seems off to you, we can merge it
as it is then improve it incrementaly.

```go
auto := []automaticCheck{
  {
    description: "Maintainers must be able to edit this pull request",
    ifC:         c.Always(),
    thenR:       r.MaintainerCanModify(),
  },
  {
    description: "The pull request head branch must be up-to-date with its base",
    ifC:         c.Always(),
    thenR:       r.UpToDateWith(gh, r.PR_BASE),
  },
  {
    description: "Changes to 'docs' folder must be reviewed/authored by at least one devrel and one tech-staff",
    ifC:         c.FileChanged(gh, "^docs/"),
    thenR: r.Or(
      r.And(
        r.AuthorInTeam(gh, "devrels"),
        r.ReviewByTeamMembers(gh, "tech-staff", 1),
      ),
      r.And(
        r.AuthorInTeam(gh, "tech-staff"),
        r.ReviewByTeamMembers(gh, "devrels", 1),
      ),
    ),
  },
}

manual := []manualCheck{
  {
    description: "The pull request description provides enough details",
    ifC:         c.Not(c.AuthorInTeam(gh, "core-contributors")),
    teams:       Teams{"core-contributors"},
  },
  {
    description: "Determine if infra needs to be updated before merging",
    ifC: c.And(
      c.BaseBranch("master"),
      c.Or(
        c.FileChanged(gh, `Dockerfile`),
        c.FileChanged(gh, `^misc/deployments`),
        c.FileChanged(gh, `^misc/docker-`),
        c.FileChanged(gh, `^.github/workflows/releaser.*\.yml$`),
        c.FileChanged(gh, `^.github/workflows/portal-loop\.yml$`),
      ),
    ),
    teams: Teams{"devops"},
  },
}
```


<details><summary>Contributors' checklist...</summary>

- [ ] Added new tests, or not needed, or not feasible
- [ ] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [ ] Updated the official documentation or not needed
- [ ] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [ ] Added references to related issues and PRs
- [ ] Provided any useful hints for running manual tests
</details>
r3v4s pushed a commit to gnoswap-labs/gno that referenced this pull request Dec 10, 2024
Related to
gnolang#3229 (comment)

This PR replaces most fixed versions of Go in the CI workflows with
retrieving the version from the relevant go.mod file.

For workflows that do not have an associated go.mod file, the go.mod
file at the root of the repository is used. All `*_template.yml`
workflows seem designed to use a fixed version of go and do not allow
passing a go.mod file to the `setup-go` action. Achieving this would
require a more significant refactor.

<details><summary>Contributors' checklist...</summary>

- [ ] Added new tests, or not needed, or not feasible
- [ ] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [ ] Updated the official documentation or not needed
- [ ] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [ ] Added references to related issues and PRs
- [ ] Provided any useful hints for running manual tests
</details>

Co-authored-by: Morgan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

4 participants