Skip to content

fix: Handles empty updated files gracefully#731

Merged
tisutisu merged 1 commit into
konflux-ci:mainfrom
tisutisu:fix-infra-deployment-update-task
Jan 10, 2024
Merged

fix: Handles empty updated files gracefully#731
tisutisu merged 1 commit into
konflux-ci:mainfrom
tisutisu:fix-infra-deployment-update-task

Conversation

@tisutisu
Copy link
Copy Markdown
Contributor

@tisutisu tisutisu commented Jan 10, 2024

It will handle situation like closing the PR like this one, when no files has been modified after running the SCRIPT parameter

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

echo -e "Script has modified files:\n$(cat ../updated_files.txt)"
else
echo "No modified files after running the script, exiting..."
exit 1
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

When can the "No modified files after running the script" situation happen? Is it an error or can it happen in normal conditions?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

(Technically, since the script is a param, I guess normal conditions. But based on our typical usage?)

Copy link
Copy Markdown
Contributor Author

@tisutisu tisutisu Jan 10, 2024

Choose a reason for hiding this comment

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

It an error condition, like when we updated the script here since the infra-deployement repo PR is yet to merge, which will have the yaml files updated by task.. so in push pipeline of build-service PR, it didnot produce any changed file in ../updated_files.txt and in result of that the following steps of the task closed the existing open PR which tries to open a PR by resetting the branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants