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

feat: scope the CI and add QoL improvements #3316

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

zivkovicmilos
Copy link
Member

Description

This PR modifies the monorepo workflows, and introduces QoL improvements to the overall CI.
The PR is not meant to be a cover-all fix for the CI, but a start on how we can begin improving it.

@gfanton We should start looking into how to group txtars soon 🙏

@zivkovicmilos zivkovicmilos self-assigned this Dec 10, 2024
@github-actions github-actions bot added the 📦 ⛰️ gno.land Issues or PRs gno.land package related label Dec 10, 2024
@Gno2D2
Copy link
Collaborator

Gno2D2 commented Dec 10, 2024

🛠 PR Checks Summary

🔴 The pull request head branch must be up-to-date with its base (more info)

Manual Checks (for Reviewers):
  • SKIP: Do not block the CI for this PR
  • Determine if infra needs to be updated before merging
Read More

🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers.

✅ Automated Checks (for Contributors):

🔴 The pull request head branch must be up-to-date with its base (more info)

☑️ Contributor Actions:
  1. Fix any issues flagged by automated checks.
  2. Follow the Contributor Checklist to ensure your PR is ready for review.
    • Add new tests, or document why they are unnecessary.
    • Provide clear examples/screenshots, if necessary.
    • Update documentation, if required.
    • Ensure no breaking changes, or include BREAKING CHANGE notes.
    • Link related issues/PRs, where applicable.
☑️ Reviewer Actions:
  1. Complete manual checks for the PR, including the guidelines and additional checks if applicable.
📚 Resources:
Debug
Automated Checks
The pull request head branch must be up-to-date with its base (more info)

If

🟢 Condition met
└── 🟢 On every pull request

Then

🔴 Requirement not satisfied
└── 🔴 Head branch (dev/zivkovicmilos/ci-qol) is up to date with base (master): behind by 3 / ahead by 7

Manual Checks
**SKIP**: Do not block the CI for this PR

If

🟢 Condition met
└── 🟢 On every pull request

Can be checked by

  • Any user with comment edit permission
Determine if infra needs to be updated before merging

If

🟢 Condition met
└── 🟢 And
    ├── 🟢 The base branch matches this pattern: master
    └── 🟢 Or
        ├── 🔴 A changed file matches this pattern: Dockerfile
        ├── 🔴 A changed file matches this pattern: ^misc/deployments
        ├── 🔴 A changed file matches this pattern: ^misc/docker-
        ├── 🟢 A changed file matches this pattern: ^.github/workflows/releaser.*\.yml$ (filename: .github/workflows/releaser-master.yml)
        └── 🟢 A changed file matches this pattern: ^.github/workflows/portal-loop\.yml$ (filename: .github/workflows/portal-loop.yml)

Can be checked by

  • team devops

Copy link
Member

Choose a reason for hiding this comment

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

The testdata here should just be to test the integration system itself

I have another proposal here that was spinning around in my brain: I actually like that in gnovm, we put the "integration tests" for the vm inside of tests. What would you think of putting txtars in gno.land/tests/scripts (or txtar, testscript, ...)

Copy link
Member

Choose a reason for hiding this comment

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

Don't think, as a consequence of my other comment, that this should be removed

Copy link
Member

Choose a reason for hiding this comment

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

Can we add an .editorconfig?

Copy link
Member

Choose a reason for hiding this comment

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

though we'll probably need it again once we start publishing for mainnet.

Copy link
Member

Choose a reason for hiding this comment

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

Manfred said we only care about this action for the event once every few years that legal remembers open source licenses exist and they ask us for an audit. I'm OK with this actually being enabled, but d we have an API key?

@zivkovicmilos zivkovicmilos requested a review from n2p5 December 10, 2024 14:56
forbidigo:
forbid:
- p: '^regexp\.(Match|MatchString)$'
msg: it will re-compile the regexp for each execution; compile the regexp with regexp.Compile and store it as a singleton
Copy link
Member

Choose a reason for hiding this comment

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

iirc the error message came out better written out (in context) as I wrote it

Copy link
Member

Choose a reason for hiding this comment

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

cmd/gno/main.go:26:2: use of `regexp.MatchString` forbidden because "it will re-compile the regexp for each execution; compile the regexp with regexp.Compile and store it as a singleton" (forbidigo)

Copy link
Member

Choose a reason for hiding this comment

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

shouldn't we test building it?

do we use it in any deployment?

@@ -1,9 +1,13 @@
name: examples
name: Gno Examples CI Suite
Copy link
Member

Choose a reason for hiding this comment

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

Keep this one short; "CI suite" is redundant.

I like "Test Examples"


on:
push:
paths:
branches:
- master
Copy link
Member

Choose a reason for hiding this comment

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

lol

@@ -1,22 +1,27 @@
name: gnovm
name: GnoVM CI Suite
Copy link
Member

@thehowl thehowl Dec 10, 2024

Choose a reason for hiding this comment

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

Also redundant, same for all others

Copy link
Member

Choose a reason for hiding this comment

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

These names matter because they show up as the names of the workflows; it's better if they're compact

Copy link

codecov bot commented Dec 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

Copy link
Contributor

@ajnavarro ajnavarro left a comment

Choose a reason for hiding this comment

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

Left some comments. The most important ones are keeping go version in less config files as possible and keep dependabot tags as they were, because they will be easier to maintain (everything needed to create a new workflow is in only one config file, you don't need to change dependabot config)

Comment on lines +43 to +68
groups:
gno-land:
paths:
- "gno.land/**"
flags:
- gno-land
gnovm:
paths:
- "gnovm/**"
flags:
- gnovm
misc:
paths:
- "misc/**"
flags:
- misc
tm2:
paths:
- "tm2/**"
flags:
- tm2
contribs:
paths:
- "contribs/**"
flags:
- contribs
Copy link
Contributor

Choose a reason for hiding this comment

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

Flags are already automatically defined here: https://github.com/gnolang/gno/pull/3316/files#diff-a8d8d916d02d13f09d2a0128a4667158fdd150a4e354d0c7a9cde6a8479b3dc5R68 so no need to define them here.

Comment on lines +70 to +90
statuses:
- type: project
flag: gno-land
target: auto
threshold: 5
- type: project
flag: gnovm
target: auto
threshold: 2 # Stricter threshold
- type: project
flag: misc
target: auto
threshold: 10
- type: project
flag: tm2
target: auto
threshold: 5
- type: project
flag: contribs
target: auto
threshold: 5
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we want to change thresholds depending on the flag? Is it really necessary?

@@ -9,6 +9,7 @@ on:
- gno.land/**
- gnovm/**
- tm2/**
- '**/*.go'
Copy link
Contributor

Choose a reason for hiding this comment

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

This is making previous filters unnecessary.

name: Run Main
uses: ./.github/workflows/main_template.yml
with:
modulepath: contribs/${{ matrix.program }}
go-version: "1.22.x"
Copy link
Contributor

Choose a reason for hiding this comment

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

moving go version outside the main template is making it scattered around more than before...

Comment on lines +10 to +13
go-version:
description: "Go version to use"
required: true
type: string
Copy link
Contributor

Choose a reason for hiding this comment

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

I prefer to keep all references to go version inside only one file: this one.

Copy link
Contributor

Choose a reason for hiding this comment

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

image

@Kouteki Kouteki added the in focus Core team is prioritizing this work label Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in focus Core team is prioritizing this work 📦 ⛰️ gno.land Issues or PRs gno.land package related
Projects
Status: In Review
Development

Successfully merging this pull request may close these issues.

5 participants