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

Add pulp plugin template check script and make target #1148

Merged
merged 3 commits into from
Mar 1, 2022

Conversation

jctanner
Copy link
Contributor

@jctanner jctanner commented Feb 28, 2022

Description 🛠

Sending a PR, getting all the tests to pass, waiting for reviews, and then being told you might have edited a file that some third party repo script is going to overwrite when the dependencies for this repo are updated ... is highly annoying.

Reviewer Checklists 👀

Developer reviewer:

  • Code looks sound, good architectural decisions, no code smells
  • There is a Jira issue associated (note that "No-Issue" should be rarely used)
  • Tests are included in galaxy_ng/tests/integration or galaxy_ng/tests/functional, and they fully cover necessary test scenarios… or tests not needed

QE reviewer (exceptions):

  • Tests are included in galaxy_ng/tests/integration or galaxy_ng/tests/functional, and they fully cover necessary test scenarios… or tests not needed
  • PR meets applicable Acceptance Criteria for associated Jira issue

Note: when merging, include the Jira issue link in the squashed commit

No-Issue

Signed-off-by: James Tanner <tanner.jc@gmail.com>
No-Issue

Signed-off-by: James Tanner <tanner.jc@gmail.com>
No-Issue

Signed-off-by: James Tanner <tanner.jc@gmail.com>

echo "Results ..."
cd $BASEDIR/galaxy_ng
MODIFIED_FILES=$(git status 2>/dev/null | grep 'modified:' | awk '{print $2}')
Copy link
Contributor

Choose a reason for hiding this comment

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

Which does this check for?

  1. PR edits file X, and plugin-template edits same file X
  2. PR edits code unrelated to CI, and plugin-template edits any file

Copy link
Contributor

Choose a reason for hiding this comment

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

oh nvm i see, this checks out the current $PLUGIN_GIT_REF

MODIFIED_FILES=$(git status 2>/dev/null | grep 'modified:' | awk '{print $2}')
EXIT_CODE=0
for MF in $MODIFIED_FILES; do
echo "FAILURE template-plugin would modifiy $BASEDIR/galaxy_ng/$MF"
Copy link
Member

Choose a reason for hiding this comment

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

So this will also fail when we run plugin_template to explicitly modify the files? how is this script differentiating when we really want to have the files edited by the template engine from when we do that by mistake?

Copy link
Contributor

Choose a reason for hiding this comment

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

it looks like this passes in that case, since it checks out the current $PLUGIN_GIT_REF listed in our repo. it validates the plugin_template ref matches all the files in our repo (they are un-edited)

@chouseknecht chouseknecht merged commit 3259948 into ansible:master Mar 1, 2022
@awcrosby awcrosby mentioned this pull request Mar 2, 2022
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants