Fix 'make verify' command#655
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/cc @inteon |
Signed-off-by: Erik Godding Boye <egboye@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes make verify resolving the wrong project root (and potentially cd-ing outside the intended directory) by switching project root detection to Git’s notion of the repository top-level.
Changes:
- Replace path-based root discovery in
verify.shwithgit rev-parse --show-toplevel. - Ensure
verify.shoperates from the Git repository root regardless of where the script lives in the filesystem.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| set -o pipefail | ||
|
|
||
| projectdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../../../.." && pwd )" | ||
| projectdir="$(git rev-parse --show-toplevel)" |
There was a problem hiding this comment.
I don't think changing this is required.
There was a problem hiding this comment.
Is this a variable we want to move to the root Makefile maybe?
There was a problem hiding this comment.
There was a problem hiding this comment.
Is this a variable we want to move to the root Makefile maybe?
Yes, that could make sense. The question is where we take it into use. 😅
There was a problem hiding this comment.
Does this work with https://github.com/cert-manager/makefile-modules/blob/243972740a13ddfb9011c8d003d092ff5c40790a/modules/generate-verify/util/verify.sh?
What do you mean? Could you explain? make verify works with this change, both here and in consumer projects.
The
make verifycommand "escapes" the project directory when executed in the makefile-modules project. This is caused by the differences in folder structure in the source and consumer projects. Using git to resolve the project dir appears to work well.