Skip to content

Add checks for dependencies that are not vendored#2596

Merged
thaJeztah merged 1 commit intodocker:masterfrom
Madhur1997:master
Jul 6, 2020
Merged

Add checks for dependencies that are not vendored#2596
thaJeztah merged 1 commit intodocker:masterfrom
Madhur1997:master

Conversation

@Madhur1997
Copy link
Copy Markdown
Contributor

Signed-off-by: Madhur Batra madhurbatra097@gmail.com

- What I did
Fix #2332: make vendor now regards 'WARNING: dependency is not vendored' as an
error and fails when some non vendored dependencies exist.

- How I did it
Added a new validation script that runs against the vndr output to find any
'WARNING: dependency is not vendored' line. If found script exits with non zero status.

- How to verify it
Added a new import in a go file, and ran go get to install the same in GOPATH.
Now vndr check failed due to unvendored dependency.

- Description for the changelog
Enhanced existing Makefile to store the vndr logs in a tmp file.
Ran a new script against the log to verify that there is no unvendored dependency.

- A picture of a cute animal (not mandatory but encouraged)

Comment thread Makefile Outdated
Comment thread scripts/validate/check-all-packages-vendored Outdated
Comment thread scripts/validate/check-all-packages-vendored
Copy link
Copy Markdown
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

thanks! left two minor nits

could you also

  • squash the commits, so that there's a single commit in this PR
  • use a descriptive first line for the commit description (e.g. "Add check for dependencies that are not vendored")
  • remove the #2332 from the commit message; I know this is often recommended, but having that reference in the commit message can create a lot of noise on GitHub (if forks of this project merge/cherry-pick the commit etc). Having the reference in the PR description on github is sufficient

Comment thread .gitignore Outdated
Comment thread .dockerignore Outdated
@Madhur1997
Copy link
Copy Markdown
Contributor Author

Thanks for the review @thaJeztah.
Updated the PR with the addressed comments.

@thaJeztah thaJeztah changed the title This commit fixes #2332 Add checks for dependencies that are not vendored Jun 25, 2020
@Madhur1997
Copy link
Copy Markdown
Contributor Author

Hey @thaJeztah

Wanted to know if there is any other review comment or am I missing anything here?
Thanks.

Copy link
Copy Markdown
Contributor

@silvin-lubecki silvin-lubecki left a comment

Choose a reason for hiding this comment

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

LGTM, thanks a lot @Madhur1997

`make vendor` fails if any dependency is not vendored.

Signed-off-by: Madhur Batra <madhurbatra097@gmail.com>
Copy link
Copy Markdown
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

whoops, sorry, thought I LGTM'd already 😅

@thaJeztah thaJeztah merged commit 66ea625 into docker:master Jul 6, 2020
@thaJeztah thaJeztah added this to the 20.03.0 milestone Aug 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: add check for missing dependencies in vendor-check

3 participants