Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 4 additions & 67 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
gcp_credentials: ENCRYPTED[f448b0e5ed38a52ba93550305f9e38c9b0c03852b9fc3115930f231fc7124b7423e8c912b4d9e002cc34b3a7ac3c145b]

# Default timeout for each task
timeout_in: 120m
timeout_in: 20m

# Default VM to use unless set or modified by task
gce_instance:
Expand All @@ -71,8 +71,6 @@


storage_linux_testing: &linux_testing
depends_on:
- storage_lint
gce_instance: # Only need to specify differences from defaults (above)
image_name: "${VM_IMAGE}"

Expand Down Expand Up @@ -136,30 +134,6 @@
- env:
TEST_DRIVER: "btrfs"


storage_lint_task:
alias: storage_lint
name: "Storage: Lint"
only_if: *only_if_storage

env:
CIRRUS_WORKING_DIR: "/go/src/github.com/containers/storage"
container:
image: golang
modules_cache:
fingerprint_script: cat storage/go.sum
folder: $GOPATH/pkg/mod
build_script: |
apt-get update
apt-get install -y libbtrfs-dev libsubid-dev
test_script: |
cd storage
[ -n "${CIRRUS_BASE_SHA}" ] && git fetch origin ${CIRRUS_BASE_SHA} # Make ${CIRRUS_BASE_SHA} resolvable for git-validation
make TAGS=regex_precompile local-validate
make lint
make clean


# Update metadata on VM images referenced by this repository state
images_timestamp_update_task:
alias: images_timestamp_update
Expand All @@ -186,10 +160,9 @@
script: '/usr/local/bin/entrypoint.sh |& ${_TIMESTAMP}'



image_validate_task:
alias: image_validate
name: "Image: Validate"
image_cross_task:
alias: image_cross
name: "Image: Cross"
only_if: &only_if_image >-
$CIRRUS_PR == '' ||
changesInclude('.cirrus.yml', 'go.work', 'go.work.sum') ||
Expand All @@ -205,23 +178,6 @@
# Eventually, hard-code FEDORA_CACHE_IMAGE_NAME here again and remove the
# VM_IMAGE_NAME parameter.
image_name: ${VM_IMAGE_NAME}
env:
HOME: "/root" # default unset, needed by golangci-lint.
VM_IMAGE_NAME: ${FEDORA_CACHE_IMAGE_NAME}
script: |
cd image
git remote update
make tools
# TODO: Enable once we are done with monorepo tests.
# ${GOBIN}/git-validation -q -run DCO,short-subject,dangling-whitespace -range $(git merge-base origin/${DEST_BRANCH} HEAD)..${CIRRUS_CHANGE_IN_REPO}
make validate


image_cross_task:
alias: image_cross
name: "Image: Cross"
only_if: *only_if_image
gce_instance: *fedora_vm
env:
HOME: "/root" # default unset, needed by golangci-lint.
VM_IMAGE_NAME: ${FEDORA_CACHE_IMAGE_NAME}
Expand All @@ -232,8 +188,6 @@

image_test_task:
alias: image_test
depends_on:
- image_validate
only_if: *only_if_image
gce_instance: *fedora_vm
env:
Expand Down Expand Up @@ -269,8 +223,6 @@
image_test_skopeo_task:
alias: image_test_skopeo
only_if: *only_if_image
depends_on:
- image_validate
gce_instance: *fedora_vm
env:
HOME: "/root" # default unset, needed by golangci-lint.
Expand Down Expand Up @@ -345,36 +297,21 @@
# gofix anyway.
git diff --diff-filter=M --exit-code -- . ":(exclude)*.crt" ":(exclude)*.key" ":(exclude)*.cert"

storage_codespell_task:
only_if: *only_if_storage
alias: storage_codespell
name: "Storage: codespell"
container:
image: python
build_script: pip install codespell
test_script: |
cd storage
codespell


# Status aggregator for all tests. This task simply ensures a defined
# set of tasks all passed, and allows confirming that based on the status
# of this task.
success_task:

Check warning on line 303 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L303

task "Total Success" depends on task "Storage: fedora-42 vfs", but their only_if conditions are different

Check warning on line 303 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L303

task "Total Success" depends on task "Storage: fedora-42 overlay", but their only_if conditions are different

Check warning on line 303 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L303

task "Total Success" depends on task "Storage: fedora-42 overlay-transient", but their only_if conditions are different

Check warning on line 303 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L303

task "Total Success" depends on task "Storage: fedora-42 fuse-overlay", but their only_if conditions are different

Check warning on line 303 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L303

task "Total Success" depends on task "Storage: fedora-42 fuse-overlay-whiteout", but their only_if conditions are different

Check warning on line 303 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L303

task "Total Success" depends on task "Storage: fedora-42 btrfs", but their only_if conditions are different

Check warning on line 303 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L303

task "Total Success" depends on task "Storage: debian-13 vfs", but their only_if conditions are different

Check warning on line 303 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L303

task "Total Success" depends on task "Storage: debian-13 overlay", but their only_if conditions are different

Check warning on line 303 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L303

task "Total Success" depends on task "Storage: debian-13 fuse-overlay", but their only_if conditions are different

Check warning on line 303 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L303

task "Total Success" depends on task "Storage: debian-13 fuse-overlay-whiteout", but their only_if conditions are different

Check warning on line 303 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L303

task "Total Success" depends on task "Storage: debian-13 btrfs", but their only_if conditions are different

Check warning on line 303 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L303

task "Total Success" depends on task "Image: Cross", but their only_if conditions are different

Check warning on line 303 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L303

task "Total Success" depends on task "Image: Test", but their only_if conditions are different

Check warning on line 303 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L303

task "Total Success" depends on task "Image: Test w/ opengpg", but their only_if conditions are different

Check warning on line 303 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L303

task "Total Success" depends on task "Test w/ Sequoia (currently Rawhide)", but their only_if conditions are different

Check warning on line 303 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L303

task "Total Success" depends on task "Image: Skopeo Test", but their only_if conditions are different

Check warning on line 303 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L303

task "Total Success" depends on task "Image: Skopeo Test w/ opengpg", but their only_if conditions are different

Check warning on line 303 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L303

task "Total Success" depends on task "Skopeo Test w/ Sequoia (currently Rawhide)", but their only_if conditions are different

Check warning on line 303 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L303

task "Total Success" depends on task "Storage: Cross", but their only_if conditions are different

Check warning on line 303 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L303

task "Total Success" depends on task "Storage: gofix", but their only_if conditions are different

Check warning on line 303 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L303

task "Total Success" depends on task "Storage: fedora-42 vfs", but their only_if conditions are different

Check warning on line 303 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L303

task "Total Success" depends on task "Storage: fedora-42 overlay", but their only_if conditions are different

Check warning on line 303 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L303

task "Total Success" depends on task "Storage: fedora-42 overlay-transient", but their only_if conditions are different

Check warning on line 303 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L303

task "Total Success" depends on task "Storage: fedora-42 fuse-overlay", but their only_if conditions are different

Check warning on line 303 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L303

task "Total Success" depends on task "Storage: fedora-42 fuse-overlay-whiteout", but their only_if conditions are different

Check warning on line 303 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L303

task "Total Success" depends on task "Storage: fedora-42 btrfs", but their only_if conditions are different

Check warning on line 303 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L303

task "Total Success" depends on task "Storage: debian-13 vfs", but their only_if conditions are different

Check warning on line 303 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L303

task "Total Success" depends on task "Storage: debian-13 overlay", but their only_if conditions are different

Check warning on line 303 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L303

task "Total Success" depends on task "Storage: debian-13 fuse-overlay", but their only_if conditions are different

Check warning on line 303 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L303

task "Total Success" depends on task "Storage: debian-13 fuse-overlay-whiteout", but their only_if conditions are different

Check warning on line 303 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L303

task "Total Success" depends on task "Storage: debian-13 btrfs", but their only_if conditions are different

Check warning on line 303 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L303

task "Total Success" depends on task "Image: Cross", but their only_if conditions are different

Check warning on line 303 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L303

task "Total Success" depends on task "Image: Test", but their only_if conditions are different

Check warning on line 303 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L303

task "Total Success" depends on task "Image: Test w/ opengpg", but their only_if conditions are different

Check warning on line 303 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L303

task "Total Success" depends on task "Test w/ Sequoia (currently Rawhide)", but their only_if conditions are different

Check warning on line 303 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L303

task "Total Success" depends on task "Image: Skopeo Test", but their only_if conditions are different

Check warning on line 303 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L303

task "Total Success" depends on task "Image: Skopeo Test w/ opengpg", but their only_if conditions are different

Check warning on line 303 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L303

task "Total Success" depends on task "Skopeo Test w/ Sequoia (currently Rawhide)", but their only_if conditions are different

Check warning on line 303 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L303

task "Total Success" depends on task "Storage: Cross", but their only_if conditions are different

Check warning on line 303 in .cirrus.yml

View check run for this annotation

Cirrus CI / Build Parsing Results

.cirrus.yml#L303

task "Total Success" depends on task "Storage: gofix", but their only_if conditions are different
alias: success
# N/B: The prow merge-bot (tide) is sensitized to this exact name, DO NOT CHANGE IT.
# Ref: https://github.com/openshift/release/pull/49820
name: "Total Success"
depends_on:
- storage_lint
- storage_fedora_testing
- storage_debian_testing
- images_timestamp_update
- storage_cross
- storage_gofix
- storage_codespell
- common_testing
- image_validate
- image_cross
- image_test
- image_test_skopeo
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions common/.codespellrc → .codespellrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
[codespell]

# Comma-separated list of files to skip.
skip = ./vendor,./.git #,bin,vendor,.git,go.sum,changelog.txt,.cirrus.yml,"RELEASE_NOTES.md,*.xz,*.gz,*.tar,*.tgz,bin2img,*ico,*.png,*.1,*.5,copyimg,*.orig,apidoc.go"
skip = ./.git,./image/signature/fixtures,./image/signature/simplesigning/testdata,./storage/tests/tools/vendor,./storage/AUTHORS

# Comma separated list of words to be ignored. Words must be lowercased.
ignore-words-list = clos,creat,ro,hastable,shouldnot,mountns,passt
ignore-words-list = clos,creat,ro,hastable,shouldnot,mountns,passt,te,bu,afile,flate,prevend,Plack,worl

# Custom dictionary file that contains spelling corrections.
# Run with option '--dictionary=-' to include also default dictionary.
Expand Down
61 changes: 0 additions & 61 deletions .github/workflows/common-validate.yml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/workflows/image-codespell.yml

This file was deleted.

96 changes: 96 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: validate

on:
push:
branches:
- main
pull_request:
branches:
- main

permissions: read-all

env:
LINT_VERSION: v2.1.6

jobs:
codespell:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: install deps
# Version of codespell bundled with Ubuntu is way old, so use pip.
run: pip install --break-system-packages codespell==v2.4.1
- name: run codespell
run: codespell --dictionary=-

lint:
runs-on: ubuntu-24.04
defaults:
run:
working-directory: ./common
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: actions/setup-go@v5
with:
go-version: 1.25.x
# By default the go cache will only use go.sum in the root which we don't have,
# make it use for all checksum files.
# https://github.com/actions/setup-go?tab=readme-ov-file#caching-dependency-files-and-build-outputs
cache-dependency-path: "**/go.sum"
- name: install deps
run: |
sudo apt-get -qq update
sudo apt-get -qq install libseccomp-dev libgpgme-dev libbtrfs-dev libsubid-dev
- name: lint-common
uses: golangci/golangci-lint-action@v8
with:
version: "${{ env.LINT_VERSION }}"
args: --verbose
working-directory: ./common
# Extra linters, only checking new code from a pull request.
- name: lint-common-extra
uses: golangci/golangci-lint-action@v8
with:
args: --config=.golangci-extra.yml
version: "${{ env.LINT_VERSION }}"
only-new-issues: true
working-directory: ./common
- name: lint-image
uses: golangci/golangci-lint-action@v8
with:
version: "${{ env.LINT_VERSION }}"
args: --verbose
working-directory: ./image
- name: lint-storage
uses: golangci/golangci-lint-action@v8
with:
version: "${{ env.LINT_VERSION }}"
args: --verbose
working-directory: ./storage

- name: validate seccomp
run: ./tools/validate_seccomp.sh ./pkg/seccomp

git-validate:
# only run this on PRs
if: github.event_name == 'pull_request'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
# By default github actions creates a merge commit which fails the validation,
# we only must validate the actual commits of the author.
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: ${{ github.event.pull_request.commits }}
- uses: actions/setup-go@v5
with:
go-version: 1.25.x
# See comment on lint task
cache-dependency-path: "**/go.sum"
- name: install deps
run: go install github.com/vbatts/git-validation@v1.2.2
- name: run git-validation
run: git-validation -q -run DCO,short-subject,dangling-whitespace -range "HEAD~${{ github.event.pull_request.commits }}..HEAD"
Copy link
Contributor

Choose a reason for hiding this comment

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

Low-priority: Does this correctly handle merge requests and the like?

I think conceptually we should include all commits not already present on the target branch, and it’s not obvious to me that counting commits is an accurate way to achieve that.

Copy link
Member Author

Choose a reason for hiding this comment

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

Why would counting not work? This should return the number of commits in the PR (well what github reports) and then we lint the diff between that commit in HEAD which should aalways check all commits in any given PR.
Do you mean like merge commits within a PR? They should still be reported and checked as normal commit I think. I mean feel free to tests the scenario you can think of out.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I was thinking something like containers/image#2876 which goes

- o - ……… - o = upstream/main
   \ - old -\  - newer

i.e the branch is “rebased on top of upstream/main” but it starts with a merge of an older commit. If I read the specification of ~ correctly, this will follow the “first parent” of the merge when following the ancestor chain, i.e. the incoming PR gets to choose which of the merge parents is included in -range, by choosing how to order the parents of the merge commit.

Copy link
Member Author

Choose a reason for hiding this comment

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

checking out that pr with git pr I see this:

$ git log --oneline HEAD~19..HEAD
8cec77c2 (HEAD -> pr/2876) Test containers_image_sequoia in CI
d2f7e941 Improve test coverage of signature/*_sequoia.go
a79ed910 With sequoia, still use GPGME for existing signing, and add a new Signer API
fd6ca715 Improve test coverage of signature/internal/sequoia/sequoia.go
0af8bd22 Close mechanisms in tests
bee9da73 Direct Rust logging to logrus
b57076c9 Allow using the default Sequoia home
89eaf0f7 Move sequoia initialization out of init()
80364d75 Remove SupportsSigning from sequoia.SigningMechanism
d673d2ac Add a ~representative test of the typical workflow to sequoia.SigningMechanism
2d9475ed Modify signature/internal/sequoia tests to run in the same package
164ef410 Fix a memory leak when loading libpodman_sequoia
6da5b5d5 Add missing error handling to go_sequoia_import_result_get_content .
79eb8840 Don't leak SequoiaMechanism instances
ad7f0391 Update the documentation of sequoiaSigningMechanism.Verify
211ffc85 Allow using sequoia in macOS
89df1aa1 Use github.com/ueno/podman-sequoia instead of a local copy of the code
da9862e5 Merge branch 'wip/signature-sequoia' of https://github.com/ueno/containers-image into signature-sequoia
19834a07 Merge pull request #2937 from containers/renovate/github.com-ulikunitz-xz-0.x
4b07216b Update module github.com/ulikunitz/xz to v0.5.13
a83a1955 signature: add OpenPGP signing mechanism based on Sequoia

So yeah it gets more commits but is also got all commits from the PR so I think that seems fine then?
I mean of course there is the risk that it fails on a commit not in that PR but that should not happen if all PRs were validated before I hope.
Although I need to double check how this interacts with the checkout action as I also have to say checkout X commits there.

Copy link
Contributor

Choose a reason for hiding this comment

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

(I’ll try to set up a definite reproducer, but I want to clean my inbox of the re-filed issues first.)

6 changes: 0 additions & 6 deletions image/.codespellrc

This file was deleted.

6 changes: 4 additions & 2 deletions image/signature/sigstore/rekor/testdata/start-rekor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ podman run -d --pod $POD_NAME --name rekor-db-$SUFFIX \

# The db takes a bit to start up, wait until it is ready otherwise the trillian
# containers fail to start due the missing db connection.
max_retries=20
max_retries=40
retries=0
while [[ $retries -le $max_retries ]]; do
out=$(podman logs rekor-db-$SUFFIX 2>&1)
Expand All @@ -46,7 +46,9 @@ while [[ $retries -le $max_retries ]]; do

retries=$((retries + 1))
if [[ $retries -ge $max_retries ]]; then
echo "Failed to wait for the database to become ready"
echo "Failed to wait for the database to become ready, logs:"
echo "$out"
podman ps
podman pod rm -f -t0 $POD_NAME
exit 1
fi
Expand Down
3 changes: 0 additions & 3 deletions storage/.codespellrc

This file was deleted.

1 change: 0 additions & 1 deletion storage/contrib/cirrus/build_and_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ pwd
ls -l
make install.tools
showrun make local-binary
showrun make local-cross

case $TEST_DRIVER in
overlay)
Expand Down