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

Add gitfs and git_pillar fallback branch #56647

Merged
merged 1 commit into from
Apr 18, 2020
Merged

Conversation

bdrung
Copy link
Contributor

@bdrung bdrung commented Apr 15, 2020

What does this PR do?

Add a fallback branch when no matching branch is found. This is a forward port of pull request #51971.

New Behavior

Example:

gitfs_remotes:
  - http://foo.com/states/top.git:
    - all_saltenvs: master
  - http://foo.com/states/apache.git:
    - fallback: master
  - http://foo.com/states/nginx.git:
    - fallback: master
  - http://foo.com/states/webapp.git:
    - fallback: develop

Where a state in webapp includes a state of apache.

With this PR, one can test a feature branch of webapp without needing to create the same branch in apache. Similarly, one can test a feature branch of apache without needing to create the same branch in webapp.

Merge requirements satisfied?

  • Docs
  • Changelog
  • Tests written/updated

Add a fallback branch when no matching branch is found. Example:

```yaml
gitfs_remotes:
  - http://foo.com/states/top.git:
    - all_saltenvs: master
  - http://foo.com/states/apache.git:
    - fallback: master
  - http://foo.com/states/nginx.git:
    - fallback: master
  - http://foo.com/states/webapp.git:
    - fallback: develop
```

Where a state in `webapp` includes a state of `apache`.

With this change, one can test a feature branch of `webapp` without
needing to create the same branch in `apache`. Similarly, one can test a
feature branch of `apache` without needing to create the same branch in
`webapp`.

This is a forward port of pull request saltstack#51971 from Mathieu Parent.

Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
@bdrung bdrung requested a review from a team as a code owner April 15, 2020 11:21
@waynew waynew added this to PR needs merge to master in PRs to port to master via automation Apr 16, 2020
@waynew
Copy link
Contributor

waynew commented Apr 17, 2020

Excellent, thanks for porting this to master!

@dwoz dwoz merged commit 3359aac into saltstack:master Apr 18, 2020
PRs to port to master automation moved this from PR needs merge to master to PR merged Apr 18, 2020
@bdrung bdrung deleted the gitfs-fallback branch April 20, 2020 12:30
@sagetherage sagetherage added the ZRelease-Sodium retired label label May 18, 2020
@sagetherage sagetherage added this to Done in Sodium May 19, 2020
if os.path.isabs(path) or (
not salt.utils.stringutils.is_hex(tgt_env) and tgt_env not in self.envs()
):
if os.path.isabs(path):
Copy link
Contributor

Choose a reason for hiding this comment

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

@dwoz Can you explain this change? This would appear to break existing functionality which allows people to use a SHA as a saltenv in SLS files (or when using cp.cache_file).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ZRelease-Sodium retired label
Projects
Sodium
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

5 participants