-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Vendor check #2259
Vendor check #2259
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vrothberg 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 |
Why isn't this wiping out the extra stuff Varlink vendors, I wonder? There are files that we're definitely not using in that vendor tree (using in the main code, at least... it builds a separate binary we use in the build phase), and I don't think we've told vndr that directory should be treated specially |
make vendor has a whitelist :)
…On Sun 3. Feb 2019 at 16:13, Matthew Heon ***@***.***> wrote:
Why isn't this wiping out the extra stuff Varlink vendors, I wonder? There
are files that we're definitely not using in that vendor tree (using in the
main code, at least... it builds a separate binary we use in the build
phase), and I don't think we've told vndr that directory should be treated
specially
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2259 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ALI4g0OwMIVeyKNaFitbvlrFGkHYPYedks5vJvyVgaJpZM4agCKJ>
.
|
I would prefer to have new checks like this go into Cirrus, since PAPR is in maintenance mode. I think what you're doing here could happen inside a container, no? Something like: diff --git a/.cirrus.yml b/.cirrus.yml
index 0efe7380..00927f32 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -110,6 +110,25 @@ gating_task:
- '/usr/local/bin/entrypoint.sh lint'
+vendor_check_task:
+
+ depends_on:
+ - "gating"
+
+ env:
+ CIRRUS_WORKING_DIR: "/usr/src/libpod"
+
+ # Runs within Cirrus's "community cluster"
+ container:
+ image: "quay.io/libpod/gate:latest"
+ cpu: 4
+ memory: 12
+
+ gate_script:
+ - '/usr/local/bin/entrypoint.sh vendor'
+ - 'cd /go/src/github.com/containers/libpod && ./hack/tree_status.sh'
+
+
build_each_commit_task:
depends_on:
@@ -253,6 +272,7 @@ success_task:
depends_on: # ignores any dependent task conditions
- "gating"
+ - "vendor_check"
- "testing"
- "optional_testing"
- "cache_images" (not tested: I think I spelled everything correctly) |
Yes please; I’ve been frustrated a quite few times by repositories that immediately break when running Keeping |
@vrothberg Hmm, one thing just occurred to me: If a contributor fixes a small typo, their PR could be the unlucky one that finds vendor code is out of date. In other words, it may not be fair to place this burden on everyone, all the time. What do you think , if we limit this check to only running after merge? When the post-merge testing fails, it puts an ugly red mark on the front-page: https://github.com/containers/libpod#library-and-tool-for-running-oci-based-containers-in-pods In theory that means it will get noticed...eventually 😄 |
(hint: See the |
Sounds great! Can we get this check to run only for 1 job and not all to avoid redundant checks?
I don't think this could happen as we do not vendor branches anymore. The CI will only complain when the code, vendor.conf and the vendor directory are not in sync anymore and I think that's the right thing to do. This way, we can be sure that everything's in line. To push it a bit further: with this change, we actually protect contributors from cleaning up or dealing with the vendor mess. Unfortunately, it is very common that much more things get changed when running |
@vrothberg oohhh, |
@cevich @vrothberg Is this ready to merge? |
@rhatdan Not yet thx for asking. |
@vrothberg in fact, if you want, this could be even simpler: Just tack the new commands onto the end of the existing 'gate' task's script section. That will cause your check to gate ALL other testing if it fails. So long as the check is quick, there's no reason for it to live in a separate task. I'm fine either way. |
16e1e20
to
7097661
Compare
7097661
to
e142039
Compare
4facd42
to
a849994
Compare
@cevich, thanks for your great input! I changed the PR accordingly and also made |
@vrothberg Hehe, 36-seconds to run 😄 I thought it would take many more minutes. Thanks for writing up what this does! Future maintainers and automation-junkies will appreciate that. Now that you've got it working, and since it's so fast, what do you think about just including this check in the existing gating task (it's the same environment, and won't add much time)? Also can we put your write up into the main docs? diff --git a/.cirrus.yml b/.cirrus.yml
index dbd0e8b3..ea961a31 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -109,6 +109,12 @@ gating_task:
- '/usr/local/bin/entrypoint.sh validate'
- '/usr/local/bin/entrypoint.sh lint'
+ vendor_script:
+ - '/usr/local/bin/entrypoint.sh .install.vndr'
+ - '/usr/local/bin/entrypoint.sh vendor'
+ - 'cd /go/src/github.com/containers/libpod && ./hack/tree_status.sh'
+
+
build_each_commit_task:
depends_on:
diff --git a/contrib/cirrus/README.md b/contrib/cirrus/README.md
index e175479f..db93c6b2 100644
--- a/contrib/cirrus/README.md
+++ b/contrib/cirrus/README.md
@@ -28,6 +28,10 @@ task (pass or fail) is set based on the exit status of the last script to execut
4. ``lint``: Execute regular `make lint` to check for any code cruft.
Should also run for less than a few minutes.
+5. ``vendor``: runs `make vendor` followed by `./hack/tree_status.sh` to check whether the
+ git tree is clean. The reasoning for that is to make sure that the vendor.conf,
+ the code and the vendored packages in ./vendor are in sync at all times.
+
### ``testing`` Task
There, now it's a perfect, polished, glossy-black finish on a race-car, and surely I best stop waxing it or it will never cross any finish-line 😃 |
a849994
to
f5788c6
Compare
Done ✔️ |
f5788c6
to
870b13b
Compare
/lgtm |
@vrothberg oh joy of joys. Was just talking about that with @edsantiago the other day. I fear it might be a royal PITA 😢 (the dependencies are many in number from what Ed said). |
@cevich my comment that day was that it was a mess because ginkgo wasn't vendored in; I think the least-awful approach is to vendor it + deps. |
/retest |
0420b36
to
ecf2e8d
Compare
Done 👍 |
33c5fd4
to
7cc0ec6
Compare
This is getting seriously frustrating. Parts of the |
7cc0ec6
to
dde59a1
Compare
This reverts commit edf16be as it's not adding all changes from the used buildah commit. Adding all breaks the build as libpod is not yet using cobra. Signed-off-by: Valentin Rothberg <[email protected]>
Remove some unused files in ./vendor via `make vendor`. Signed-off-by: Valentin Rothberg <[email protected]>
* Make sure that all vendored dependencies are in sync with the code and the vendor.conf by running `make vendor` with a follow-up status check of the git tree. * Vendor ginkgo and gomega to include the test dependencies. Signed-off-by: Chris Evic <[email protected]> Signed-off-by: Valentin Rothberg <[email protected]>
dde59a1
to
9ac0ebb
Compare
The vendored buildah had a very similar issue, so I reverted the breaking commit and cleaned up the varlink stuff. |
Green 🙏 |
/lgtm |
PR containers#2259 removed the .install.gomega Makefile target but didn't clean up two references to it. Do so now. Also, when setting up GOPKGBASEDIR symlink, use -f (force) flag; otherwise subsequent makes will fail. Signed-off-by: Ed Santiago <[email protected]>
This PR aims at enforcing always synchronized and up to date dependencies by running
make vendor
with a follow-up git-status check via papr. This way, we don't have to worry about the state of vendor.conf as the CI will complain if something is out of sync, or if certain packages are not needed anymore in ./vendor.The idea to do this popped up over at CRI-O but I figured to start here, given the dependencies are already cleaned up :) If desired, I can open similar PRs over at Buildah and Skopeo.
Cc: @cevich @runcom @baude @mheon @rhatdan @mtrmac @TomSweeneyRedHat