chore(x2a): change publish phase actions order#3551
Conversation
change comments
Changed Packages
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3551 +/- ##
=======================================
Coverage 53.74% 53.74%
=======================================
Files 2268 2268
Lines 86468 86468
Branches 24246 24247 +1
=======================================
Hits 46468 46468
Misses 38441 38441
Partials 1559 1559
*This pull request uses carry forward flags. Click here to find out more. Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
eloycoto
left a comment
There was a problem hiding this comment.
In the publish, it commits twice, no?
cleanup() {
local exit_code=$?
set +e
# Always try to commit and push whatever is in the working directory
if [ -d /workspace/target/.git ]; then
local commit_msg="x2a: ${PHASE} phase for ${MODULE_NAME:-project}
Phase: ${PHASE}
Project: ${PROJECT_ID}
Module: ${MODULE_NAME:-N/A}
Job: ${JOB_ID}
Co-Authored-By: ${GIT_AUTHOR_NAME} <${GIT_AUTHOR_EMAIL}>
"
git_commit_and_push "${commit_msg}" false # Don't exit on error in cleanup
fi
if [ "$TERMINATED" = true ]; then
report_result "error" "Job was terminated"
elif [ ${exit_code} -ne 0 ]; then
report_result "error" "${ERROR_MESSAGE:-Script failed with exit code ${exit_code}}"
elif [ -n "${PUSH_FAILED}" ]; then
report_result "error" "${PUSH_FAILED}"
else
report_result "success" ""
fi
}
so, should be a check that SKIP_COMMIT entry, no?
| # This ensures AAP syncs the latest commit with the new playbooks | ||
| echo "" | ||
| echo "=== Committing and pushing Ansible project to git ===" | ||
| git_commit_and_push "x2a: ${PHASE} phase for ${MODULE_NAME} |
There was a problem hiding this comment.
can we define the variable for the commit message? it's easy to read the function and the input-variable.
There was a problem hiding this comment.
like the cleanup: local commit_msg



Fix: Ensure AAP syncs after GitHub push completes (FLPATH-4398)
Problem
AAP was unable to discover migrated Ansible playbooks because it was syncing the Git repository before GitHub
finished processing the push..
Root Cause
The job script was calling publish-aap (which triggers AAP project sync) immediately after generating the Ansible
project files, but before committing and pushing to GitHub. This created a race condition where AAP's sync often
completed before the new playbooks were available on GitHub.
Solution
This PR refactors the job script to:
Changes
New git_commit_and_push() helper function: