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

Fix root folder reference #84

Merged
merged 19 commits into from
Sep 30, 2024
Merged

Fix root folder reference #84

merged 19 commits into from
Sep 30, 2024

Conversation

neel-astro
Copy link
Collaborator

@neel-astro neel-astro commented Sep 26, 2024

Changes:

  • Fix a case when root-folder is not specified, and deploy-action would cd into the home folder, and fail to fetch updated files as a result
  • Fix a case where the image-and-dags deploy type would skip deploy when a dag file is updated
  • Fix the e2e test case which was relying on actual git still, as I forgot to add mock to it, because of which the outcome of the test varied based on the changes in the commit

Because we can't test this edge case as part of the e2e test suite, I had to test it in a separate repo: https://github.com/neel-astro/example-repo-update/actions/workflows/push-to-main.yaml?query=branch%3Amain

run: |

# set to no deploy git mock, to simulate no interested file change scenario
mv e2e-setup/mocks/no-deploy-git.sh /usr/local/bin/git
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixing a case that I found after merging my previous PR, as for the no-deploy case we want to simulate a change in a file outside the root folder. This is

@neel-astro neel-astro marked this pull request as ready for review September 26, 2024 21:06
@neel-astro neel-astro requested a review from a team as a code owner September 26, 2024 21:06
Copy link
Collaborator

@jeremybeard jeremybeard left a comment

Choose a reason for hiding this comment

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

Approving ahead of some comments to address.

action.yaml Outdated Show resolved Hide resolved
action.yaml Outdated Show resolved Hide resolved
action.yaml Show resolved Hide resolved
action.yaml Outdated
for file in $files; do
if [[ $file =~ ^"${{ inputs.root-folder }}".* ]]; then
if [[ $file =~ ^"$root_folder".* ]]; then
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we also need some kind of validation that the root folder does not start with a forward slash, which presumably would not match with any file?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

agree on having the validation, also there are a couple of other places that could benefit from having upfront validation rather than having to fail later. But I would prefer to decouple that from this patch release so that we are focused on fixing bugs introduced in 0.7. (Will drop an issue so that we don't loose track of it)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

issue to track the change: #85

Copy link

Choose a reason for hiding this comment

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

Currently we run astronomer/[email protected] prior to astro deployment variable update in CI. If there are no changes, this step fails. Will set the root-folder to see if that gets us moving forward. Ideally these changes could be versioned, if possible, though.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yup, since this is a fix, we are planning to release a v0.7.1 with these PR changes

.github/workflows/tests.yaml Show resolved Hide resolved
@neel-astro neel-astro merged commit 6e70894 into main Sep 30, 2024
17 checks passed
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