Skip to content
This repository has been archived by the owner on Feb 1, 2021. It is now read-only.

Add support for sourcing chart from head ref when testing pull request #38

Merged
merged 4 commits into from
Jun 9, 2020

Conversation

mksh
Copy link
Contributor

@mksh mksh commented Jun 3, 2020

This is based on #33 and intended to solve the same problem.

How to clone a right helm chart source in the case when helm chart referenced in a helm release being tested by hrval-action is located in the same git repository, where hrval-action is run ?

In case of pull request, if a pull request base repository branch is referenced in helm release, hrval-action might be executed against invalid version of helm chart source, other than one contained in head repository branch.

Algorithm:

  • when HRVAL_BASE_BRANCH and HRVAL_HEAD_BRANCH environment variables are set, for each helm chart being tested,
    • detect if Helm Release chart reference contains link to a repository where hrval-action currently runs and the ref specified equals to value specified in HRVAL_BASE_BRANCH environment variable
    • if such Helm Release have been encountered, fetch chart source from git ref specified in HRVAL_HEAD_BRANCH environment variable
    • otherwise, proceed with original ref setting

This patch is non-intrusive, and a pre-patch behavior will be executed in case if HRVAL_BASE_BRANCH and HRVAL_HEAD_BRANCH variables are not set.

stevenpall and others added 3 commits March 30, 2020 11:41
- environment variables based support for detecting helm releases where
  chart source is located in a head repository, and cloning right
  helm chart version from a head source
Copy link
Owner

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

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

Can you please add a section to the docs

@mksh
Copy link
Contributor Author

mksh commented Jun 8, 2020

Sure, have added documentation for this feature to Readme

Copy link
Owner

@stefanprodan stefanprodan 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 @mksh

@stefanprodan stefanprodan merged commit 97343e5 into stefanprodan:master Jun 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants