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

Make e2e tests pull main branch of kedro-starters when using tools #3518

Merged
merged 23 commits into from
Jan 18, 2024

Conversation

SajidAlamQB
Copy link
Contributor

@SajidAlamQB SajidAlamQB commented Jan 16, 2024

Description

Our CI will use the same tag version of kedro-starters as kedro but this causes a problem when we want to do a new kedro release as the new release tag won't exist on starters until we do the release. So we should make our e2e test run on the main branch of kedro-starters for tests involving the tools cli or find an alternative solution.

Development notes

What I've tried:

Method 3:

After pairing with @merelcht we decided to move the tests that are causing issues to kedro-starters see kedro-org/kedro-starters#209 for more info.

Method 2:

I tried using environment variables in GitHub actions to change the checkout branch to main if it detects that a CI is running it. This doesn't feel like the best solution as it modifies the core code to get tests working. Update: after speaking with @merelcht we decided this method is not the best idea as it modifies production code to make tests pass.

Method 1:

I've added try and catch block for RepositoryCloneFailed from cookiecutter. If it catches RepositoryCloneFailed it will modify it to return the main branch of kedro-starters. This will effect both --tools when using --example and --starters when it uses --checkout. In both instances users will be warned that the version they were looking for was not found and it will default to using the main branch. This will effectively solve the issue but does change the behaviour of using non existing versions instead of outright failing it will have a fallback mechanic. Would love to get some thoughts on this.

Ultimately this wouldn't work for all cases only when new releases happen so will forgo this method.

NOTE: The fix for unit tests has been done in the ruff PR: https://github.com/kedro-org/kedro/pull/3435 (I added a minor fix that was introduced in that PR that I overlooked, it just makes the `cookiecutter_args` into a `fixture` and uses on `class` level instead of `function`)

Developer Certificate of Origin

We need all contributions to comply with the Developer Certificate of Origin (DCO). All commits must be signed off by including a Signed-off-by line in the commit message. See our wiki for guidance.

If your PR is blocked due to unsigned commits, then you must follow the instructions under "Rebase the branch" on the GitHub Checks page for your PR. This will retroactively add the sign-off to all unsigned commits and allow the DCO check to pass.

Checklist

  • Read the contributing guidelines
  • Signed off each commit with a Developer Certificate of Origin (DCO)
  • Opened this PR as a 'Draft Pull Request' if it is work-in-progress
  • Updated the documentation to reflect the code changes
  • Added a description of this change in the RELEASE.md file
  • Added tests to cover my changes
  • Checked if this change will affect Kedro-Viz, and if so, communicated that with the Viz team

@SajidAlamQB SajidAlamQB self-assigned this Jan 16, 2024
Signed-off-by: Sajid Alam <[email protected]>
Signed-off-by: Sajid Alam <[email protected]>
@SajidAlamQB SajidAlamQB changed the title Make tests run main branch version of kedro-starters when using tools Make e2e tests run main branch version of kedro-starters when using tools Jan 17, 2024
Signed-off-by: Sajid Alam <[email protected]>
@SajidAlamQB SajidAlamQB changed the title Make e2e tests run main branch version of kedro-starters when using tools Make e2e tests pull main branch of kedro-starters when using tools Jan 17, 2024
@SajidAlamQB SajidAlamQB mentioned this pull request Jan 17, 2024
7 tasks
@SajidAlamQB SajidAlamQB marked this pull request as draft January 18, 2024 10:56
@SajidAlamQB SajidAlamQB marked this pull request as ready for review January 18, 2024 13:11
Copy link
Member

@merelcht merelcht left a comment

Choose a reason for hiding this comment

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

Great work fixing this! 🎉 ⭐

Signed-off-by: Sajid Alam <[email protected]>
Signed-off-by: Sajid Alam <[email protected]>
Signed-off-by: Sajid Alam <[email protected]>
Signed-off-by: Sajid Alam <[email protected]>
Copy link
Contributor

@ankatiyar ankatiyar left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @SajidAlamQB :)

Signed-off-by: Sajid Alam <[email protected]>
@SajidAlamQB SajidAlamQB merged commit 3d14cea into main Jan 18, 2024
28 checks passed
@SajidAlamQB SajidAlamQB deleted the run-kedro-starters-main-branch-on-ci branch January 18, 2024 17:55
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