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

cirrus.yml: automatic skips based on source #23174

Merged
merged 1 commit into from
Jul 4, 2024

Conversation

Luap99
Copy link
Member

@Luap99 Luap99 commented Jul 3, 2024

As we want to get rid of the special titles convert the existing skips to the only_if condition, this makes it more readable as we do not need to negate so much.

Then add similar conditions for all test tasks, this removes the need to a special title such as CI:DOCS as the logic is smart enough to only docs changes when no source code was changed.

Does this PR introduce a user-facing change?

None

@openshift-ci openshift-ci bot added release-note-none do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Jul 3, 2024
Copy link
Contributor

openshift-ci bot commented Jul 3, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Luap99

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 3, 2024
Copy link

We were not able to find or create Copr project packit/containers-podman-23174 specified in the config with the following error:

Cannot create a new Copr project (owner=packit project=containers-podman-23174 chroots=['centos-stream-9-x86_64', 'centos-stream-9-aarch64', 'centos-stream-10-aarch64', 'centos-stream-10-x86_64']): Copr: 'packit/containers-podman-23174' already exists

Please check your configuration for:

  1. typos in owner and project name (groups need to be prefixed with @)
  2. whether the project name doesn't contain not allowed characters (only letters, digits, underscores, dashes and dots must be used)
  3. whether the project itself exists (Packit creates projects only in its own namespace)
  4. whether Packit is allowed to build in your Copr project
  5. whether your Copr project/group is not private

@Luap99
Copy link
Member Author

Luap99 commented Jul 3, 2024

TODO: fix the docs in CIModes.md and test these changes in separate PRs

# Docs: ./contrib/cirrus/CIModes.md
only_if: &not_tag_branch_build_docs_machine >-
$CIRRUS_PR != '' &&
Copy link
Member Author

Choose a reason for hiding this comment

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

This is what I don't understand. Docker-py, apiv2, compose tests were all skipped in cron runs?
@cevich why?

I changed it so they run because I see no reason why they should not

Copy link
Member

Choose a reason for hiding this comment

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

IIRC, we use to skip nearly everything except build and system tests. I'm not opposed to re-adding everything back in given that we're now extensively skipping in PRs.

@@ -60,20 +60,20 @@ def test_depends(self):
msg=('No success aggregation task depends_on "{0}"'.format(task_name))
self.assertIn(task_name, success_deps, msg=msg)

def test_skips(self):
def test_only_if(self):
"""2024-06 PR#23030: ugly but necessary duplication in skip conditions. Prevent typos or unwanted changes."""
Copy link
Member Author

Choose a reason for hiding this comment

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

not to self update PR number to this one for next push

Copy link
Member

Choose a reason for hiding this comment

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

oops

@Luap99
Copy link
Member Author

Luap99 commented Jul 3, 2024

Note I pushed a extra commit in case somone already looked at the existing changes, I will squash them once this is ready.

@Luap99
Copy link
Member Author

Luap99 commented Jul 3, 2024

Copy link
Member

@edsantiago edsantiago left a comment

Choose a reason for hiding this comment

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

This is so much better, thank you. Three tweaks needed (because of bats "load"), and one question about deduplication

@Luap99
Copy link
Member Author

Luap99 commented Jul 3, 2024

unrelated to the PR but two f39 int timeouts look concerning

@edsantiago
Copy link
Member

Both timeouts happen shortly after ~500s which seems odd.

Yesterday I saw a bunch of (what looked like) Cirrus provisioning errors. I wonder if these are similar, or perhaps fallout from those?

Comment on lines -45 to -48
### Intended general PR Tasks (*italic*: matrix)
+ *build*
+ validate
+ bindings
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 have removed these parts because I find them very strange they just duplicate knowledge from the cirrus.yml without explanation and this is out of date and was not updated anyway

Copy link
Member

Choose a reason for hiding this comment

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

GOOD! Thank you!

Copy link
Member

@edsantiago edsantiago left a comment

Choose a reason for hiding this comment

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

Some comments say "source code is changed", some say "source code is changed AND NOT only test files". This suggests there's a difference in behavior, but AFAICT there isn't. Could you pick one of those for all? Or maybe "actual source code", "non-test source code changed", or something like that?

This is really good work.

@@ -60,20 +60,20 @@ def test_depends(self):
msg=('No success aggregation task depends_on "{0}"'.format(task_name))
self.assertIn(task_name, success_deps, msg=msg)

def test_skips(self):
def test_only_if(self):
"""2024-06 PR#23030: ugly but necessary duplication in skip conditions. Prevent typos or unwanted changes."""
Copy link
Member

Choose a reason for hiding this comment

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

oops

@edsantiago
Copy link
Member

FYI I've added a TODO item to reexamine https://github.com/containers/podman/blob/main/contrib/cirrus/pr-should-include-tests and find a solution that does not involve CI:DOCS

@Luap99
Copy link
Member Author

Luap99 commented Jul 3, 2024

FYI I've added a TODO item to reexamine https://github.com/containers/podman/blob/main/contrib/cirrus/pr-should-include-tests and find a solution that does not involve CI:DOCS

Idea: move the pr-should-include-tests into its own task and then have a condition to only run this task when source files are changed.
But thanks for bringing this up I haven't thought about this case.

As we want to get rid of the special titles convert the existing skips
to the only_if condition, this makes it more readable as we do not need
to negate so much.

Then add similar conditions for all test tasks, this removes the need to
a special title such as CI:DOCS as the logic is smart enough to only
docs changes when no source code was changed.

Update the documentation for the new logic and no longer point
contributors to the CI:DOCS title as it is gone now.

There is a bunch of duplication in the rules as yaml doesn't allow us to
share only parts of a string. To prevent unwanted drift a test case in
contrib/cirrus/cirrus_yaml_test.py is added to ensure all conditions
follow the same base ruleset.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
@edsantiago
Copy link
Member

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 4, 2024
@Luap99 Luap99 marked this pull request as ready for review July 4, 2024 12:19
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 4, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 0358325 into containers:main Jul 4, 2024
89 of 90 checks passed
@Luap99 Luap99 deleted the cirrus-skips branch July 4, 2024 17:52
edsantiago added a commit to edsantiago/libpod that referenced this pull request Jul 17, 2024
Background: As of containers#23174, CI is selectively run depending on
the set of files changed. Changes to version.go should require
a full run of all tests, because we want releases tested.

Problem: RC releases bump version.go and then bump it back.
Cirrus's changesInclude() sees this as a NOP, so it does
not trigger the "run all CI tests" rule.

Solution: require CI:ALL in release PRs. Add step to process.

Signed-off-by: Ed Santiago <santiago@redhat.com>
@stale-locking-app stale-locking-app bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Oct 3, 2024
@stale-locking-app stale-locking-app bot locked as resolved and limited conversation to collaborators Oct 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants