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: update bats and zot versions #581

Closed
wants to merge 6 commits into from
Closed

Conversation

rchincha
Copy link
Contributor

Update Makefile to bump up zot version
Update Makefile to include a recipe to install latest bats

What type of PR is this?

Which issue does this PR fix:

What does this PR do / Why do we need it:

If an issue # is not available please add repro steps and logs showing the issue:

Testing done on this change:

Automation added to e2e:

Will this break upgrades or downgrades?

Does this PR introduce any user-facing change?:


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@rchincha rchincha force-pushed the deps branch 3 times, most recently from 4ed4b3e to 6ce0d6e Compare January 10, 2024 21:37
Copy link
Contributor

@smoser smoser left a comment

Choose a reason for hiding this comment

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

suggested changes in rchincha#10

Makefile Outdated
@@ -138,6 +140,12 @@ $(SKOPEO):
cd $(TOP_LEVEL); \
rm -rf $$tmpdir;

$(BATS):
rm -rf bats-core; \
Copy link
Contributor

Choose a reason for hiding this comment

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

see #579 you need to 'set -e' here, or you end up exiting with the value of 'rm -rf bats-core', which is probably going to be 0.

Makefile Outdated
@@ -41,9 +41,11 @@ REGCLIENT := $(TOOLS_D)/bin/regctl
REGCLIENT_VERSION := v0.5.1
export SKOPEO = $(TOOLS_D)/bin/skopeo
export SKOPEO_VERSION = 1.9.3
export BATS = $(TOOLS_D)/bin/bats
Copy link
Contributor

Choose a reason for hiding this comment

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

there is no reason to export this if you never use it.
just drop the 'export'

Makefile Outdated
@@ -37,13 +37,16 @@ LXC_BRANCH?=stable-5.0
HACK_D := $(TOP_LEVEL)/hack
# helper tools
TOOLS_D := $(HACK_D)/tools
export PATH := $(TOOLS_D)/bin:$(PATH)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Does this even work with sudo -E?

Copy link
Contributor

Choose a reason for hiding this comment

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

$ export PATH=/tmp/foo:$PATH ; sudo -E sh -c 'echo $PATH'
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin

sudo(8) says:

PATH May be overridden by the security policy.

So i guess this doesn't work at least in the default ubuntu path here.

So I guess we have to leave PATH=PATH.

@@ -164,10 +171,8 @@ check-cov: lint test-cov

.PHONY: test-cov
test-cov: stacker-cov $(REGCLIENT) $(SKOPEO) $(ZOT)
sudo -E PATH="$$PATH" \
Copy link
Contributor

Choose a reason for hiding this comment

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

so we do need this.

Makefile Outdated
@@ -37,13 +37,16 @@ LXC_BRANCH?=stable-5.0
HACK_D := $(TOP_LEVEL)/hack
# helper tools
TOOLS_D := $(HACK_D)/tools
export PATH := $(TOOLS_D)/bin:$(PATH)
Copy link
Contributor

Choose a reason for hiding this comment

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

$ export PATH=/tmp/foo:$PATH ; sudo -E sh -c 'echo $PATH'
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin

sudo(8) says:

PATH May be overridden by the security policy.

So i guess this doesn't work at least in the default ubuntu path here.

So I guess we have to leave PATH=PATH.

@rchincha rchincha force-pushed the deps branch 4 times, most recently from 5679dae to 8b3bcf2 Compare January 17, 2024 00:15
Copy link

codecov bot commented Jan 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (554db17) 57.11% compared to head (a31c9e3) 56.50%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #581      +/-   ##
==========================================
- Coverage   57.11%   56.50%   -0.62%     
==========================================
  Files          64       64              
  Lines        7520     7520              
==========================================
- Hits         4295     4249      -46     
- Misses       2483     2549      +66     
+ Partials      742      722      -20     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

rchincha and others added 4 commits January 17, 2024 02:21
Update Makefile to bump up zot version
Update Makefile to include a recipe to install latest bats

Signed-off-by: Ramkumar Chinchani <[email protected]>
Clean up makefile for:
 * modify PATH with export to point at TOOLS_D/bin
   this way when test or any target is executed, the tools are in the
   path.
 * drop export of SKOPEO , just use it by name in test/.
 * Do not export BATS, it was never used anywhere
 * test targets do not need LXC_BRANCH or LXC_CLONE_URL
 * docker-clone depends on skopeo (tools/oci-copy uses it)

Signed-off-by: Scott Moser <[email protected]>
Signed-off-by: Ramkumar Chinchani <[email protected]>
Signed-off-by: Ramkumar Chinchani <[email protected]>
Makefile Outdated
sudo -E PATH="$$PATH" \
LXC_BRANCH=$(LXC_BRANCH) \
LXC_CLONE_URL=$(LXC_CLONE_URL) \
test: stacker $(REGCLIENT) $(SKOPEO) $(ZOT) $(BATS)
Copy link
Contributor

Choose a reason for hiding this comment

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

because test is a .PHONY dependencies don't matter and aren't resolved.
nothing ends up building bats and so test fails.

https://stackoverflow.com/questions/13852535/makefile-dependencies-dont-work-for-phony-target

Signed-off-by: Ramkumar Chinchani <[email protected]>
Signed-off-by: Ramkumar Chinchani <[email protected]>
@smoser
Copy link
Contributor

smoser commented Jan 18, 2024

#584 has a fix that makes this pass.

@rchincha rchincha closed this Jan 18, 2024
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.

2 participants