Skip to content

ci: add option to ignore unstable and unmaintained chisel releases - #676

Closed
lczyk wants to merge 12 commits into
canonical:mainfrom
lczyk:ROCKS-2504/add-ignore-unstable
Closed

lczyk wants to merge 12 commits into
canonical:mainfrom
lczyk:ROCKS-2504/add-ignore-unstable

Conversation

@lczyk

@lczyk lczyk commented Sep 29, 2025 •

Copy link
Copy Markdown
Collaborator

Proposed changes

adds --ignore=unstable and --ignore=unmaintained flag to the install-slices ci job.

the unstable flag is required allow #681 to not fail (at the time of writing it is unstable)

the unmaintained flag allows #677 not to fail (at the time of writing it is past its maintenance period)

note: the CI checks are going to be red across the board due to the underlying issue, until we add the maintenance field.

Related issues/PRs

#677 and #681 are part of a series of (independent) commits which implement #631, and resolves #675

Forward porting

n/a

Checklist

@lczyk lczyk changed the title feat: add ignore-unstable ci: add ignore-unstable Sep 29, 2025
@lczyk lczyk changed the title ci: add ignore-unstable ci: add option to ignore unstable and unmaintained chisel releases Sep 29, 2025
@ROCKsBot
ROCKsBot requested a review from a team September 30, 2025 01:40
@lczyk
lczyk requested a review from letFunny September 30, 2025 06:57
@lczyk lczyk mentioned this pull request Sep 30, 2025
3 tasks done
@lczyk
lczyk requested a review from cjdcordeiro September 30, 2025 07:09

@zhijie-yang zhijie-yang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good to me. Just a few nitpicks here.

@cjdcordeiro cjdcordeiro left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this doesn't feel like a sustainable solution.

I'd like to consider a smarter approach where we can detect the state of the release, and apply the ignore accordingly.

This way we avoid doomsdays where the CI just stops working cause a release went EOL, while also giving us room to introduce Pro CI runs for LTS releases that reach EOSS (like 20.04)

@cjdcordeiro

Copy link
Copy Markdown
Collaborator

this doesn't feel like a sustainable solution.

I'd like to consider a smarter approach where we can detect the state of the release, and apply the ignore accordingly.

This way we avoid doomsdays where the CI just stops working cause a release went EOL, while also giving us room to introduce Pro CI runs for LTS releases that reach EOSS (like 20.04)

For now, just to get the CI passing, I think we can just:

  1. always run with --ignore=unstable and
  2. comment 20.04 in the CI

"arch": arch,
"ref": release["ref"],
"chisel-version": chisel_version,
"ignore-flag": determine_ignore_flag(release.get("ignore", ""), chisel_version)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Interestingly, we can use a one-liner for this function

Suggested change
"ignore-flag": determine_ignore_flag(release.get("ignore", ""), chisel_version)
"ignore-flag": "--ignore-{}".format(ig) if (ig := release.get("ignore") and chisel_version == "main") else ""

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

👎 don't like the := syntax. very unreadable and hard on debuggers

@letFunny

Copy link
Copy Markdown
Collaborator

I have read the PR and I agree with the general approach. I agree with @cjdcordeiro that the most maintainable version would not hardcode data that depends on the dates. However, IMO that depends on the complexity of the solution. Changing the CI every year once does not feel that heavy.

I'd like to consider a smarter approach where we can detect the state of the release, and apply the ignore accordingly.

This feels like it should be easy on the surface, parsing the dates from YAML and replicating the business logic even if there are some more complex cases (i.e. when pro is not enabled and this is an LTS look at expanded and not at eol). However, I have the feeling it will be harder to maintain and more prone to failing because it will be replicating all the logic and might get out of sync.

With that said, both solutions look good to me.

@lczyk lczyk mentioned this pull request Sep 30, 2025
3 tasks done
@lczyk lczyk mentioned this pull request Sep 30, 2025
1 task done
@lczyk

lczyk commented Sep 30, 2025

Copy link
Copy Markdown
Collaborator Author

For now, just to get the CI passing, I think we can just:

always run with --ignore=unstable and
comment 20.04 in the CI

yeah, that was my initial idea, but dropping 'main' from 20.04 felt like a step back.

harder to maintain and more prone to failing because it will be replicating all the logic and might get out of sync.

☝️ + we are already doing a manual matrix spec. i do agree that we want to be careful about not doing too many things by hand though. hard to tell what's the optimal thing to do here tbh.

@lczyk

lczyk commented Sep 30, 2025 •

Copy link
Copy Markdown
Collaborator Author

proposal: canonical/chisel#245 (4 line change) and then always pass both --ignore=unstable and --ignore=unmaintained

i suggest we go with exactly what @cjdcordeiro suggested for now, and then, if the above is accepted, just re-add "main" to 20.04 and always run with both flags

@lczyk
lczyk requested a review from cjdcordeiro September 30, 2025 09:26
@lczyk lczyk mentioned this pull request Sep 30, 2025
3 tasks done
@lczyk lczyk self-assigned this Sep 30, 2025

@cjdcordeiro cjdcordeiro left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This PR is getting delays cause it's doing too much, for a fix that would be 4 lines:

diff --git a/.github/scripts/install-slices/install_slices.py b/.github/scripts/install-slices/install_slices.py
index c68b781..eb5e84c 100755
--- a/.github/scripts/install-slices/install_slices.py
+++ b/.github/scripts/install-slices/install_slices.py
@@ -285,7 +285,7 @@ def ignore_missing_packages(
 
 
 def install_slices(
-    chunk: list[tuple[str, str]], dry_run: bool, arch: str, release: str, worker: int
+        chunk: list[tuple[str, str]], dry_run: bool, arch: str, release: str, worker: int, extra_args: str
 ) -> None:
     """
     Install the slice by running "chisel cut".
@@ -410,6 +410,7 @@ def main() -> None:
         logging.info("No slices will be installed.")
         return
 
+    extra_args = '--ignore=unstable' if subprocess.check_output(["chisel","version"]).strip().decode().lstrip("v") > "1.2.0" else ''
     # TODO: this list of slices can still be reduced, since many of these
     # will come as essentials of other slices. We could simply crawl all essentials
     # in the release, and remove them from the "all_slices" list (since they
@@ -426,6 +427,7 @@ def main() -> None:
             cli_args.arch,
             cli_args.release,
             i // chunk_size + 1,  # worker number
+            extra_args
         )
         for i in range(0, len(all_slices), chunk_size)
     ]
diff --git a/.github/workflows/install-slices.yaml b/.github/workflows/install-slices.yaml
index 8d0b164..d9c997a 100644
--- a/.github/workflows/install-slices.yaml
+++ b/.github/workflows/install-slices.yaml
@@ -24,7 +24,7 @@ env:
   ARCHES: '["amd64","arm64","armhf","ppc64el","riscv64","s390x"]'
   RELEASES_COMPATIBILITY: |
     [
-      {"ref": "ubuntu-20.04", "chisel-versions": ["v1.1.0","v1.2.0","main"]},
+      {"ref": "ubuntu-20.04", "chisel-versions": ["v1.1.0","v1.2.0"]},
       {"ref": "ubuntu-22.04", "chisel-versions": ["v1.1.0","v1.2.0","main"]},
       {"ref": "ubuntu-24.04", "chisel-versions": ["v1.1.0","v1.2.0","main"]},
       {"ref": "ubuntu-25.04", "chisel-versions": ["v1.1.0","v1.2.0","main"]},

The rest of the smartness and refactoring should be done on a follow up PR, since this is a blocking issue that you want to get merged fast.

Comment on lines +85 to +87
# and the entry in RELEASES_COMPATIBILITY contains "main" in "chisel-versions"
jq_program='[.[] | select(.ref == $ref) | select(.["chisel-versions"] | index("main")) | ."chisel-versions" = ["main"]]'
ref="$(echo "$RELEASES_COMPATIBILITY" | jq --arg ref "$branch" "$jq_program")"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

why? seems unnecessary

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

otherwise it is trying to install with main on this PR (and will also on others like it). see here for example

@lczyk lczyk mentioned this pull request Sep 30, 2025
3 tasks done
@lczyk

lczyk commented Sep 30, 2025 •

Copy link
Copy Markdown
Collaborator Author

This PR is getting delays cause it's doing too much

how about #683? i would then rebase this PR on top

@ROCKsBot
ROCKsBot requested a review from a team October 1, 2025 01:36
@lczyk lczyk mentioned this pull request Oct 2, 2025
3 tasks done
@lczyk
lczyk marked this pull request as draft October 3, 2025 20:37
@lczyk
lczyk removed the request for review from letFunny October 3, 2025 20:37
@lczyk

lczyk commented Oct 3, 2025

Copy link
Copy Markdown
Collaborator Author

closing this since necessary changes made in #683. can later port changes to another PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: failure due to no maintenance info

4 participants