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

Property "use-config-as-code-from-default-branch" disallows overriding properties with branch's own cx.config #793

Open
cx-scord opened this issue Aug 5, 2021 · 0 comments
Assignees
Labels

Comments

@cx-scord
Copy link
Contributor

cx-scord commented Aug 5, 2021

Description

Setting use-config-as-code-from-default-branch property to true will void any possibility of a push/PR on a non-default protected branch overriding some CxFlow properties using the branch's cx.config file. For example, if the default branch's cx.config is filtering Highs and Mediums, by changing it on the protected branch's cx.config file to filter only Highs when the code is pushed is currently impossible.
`

Expected Behavior

Use the protected branch's cx.config file to override the CxFlow configuration property on a push/pr event.

Could be accomplished by having a non-binary way to tell CxFlow what events should trigger the fetch of config-as-code's cx.config from the default branch, by replacing the use-config-as-code-from-default-branch: true|false property with something like:

github:
  use-config-as-code-from-default-branch-on:
  - delete
  - pushreq
  - pullreq

The default option here should be exclusively for the "delete" event since it's the only event when you usually require a cx.config from the default branch to be fetc since the branch's cx.config code will not be present after the branch is deleted.

This should be the rule for other supported SCMs as well, like when using Azure DevOps' CxFlow configuration property deleteCxProject: true|false that deletes a project when the feature branch is deleted. This should also be changed to something like:

azure:
  deleteCxProject-on:
  - delete
  - pushreq
  - pullreq

There might be times when using the config-as-code from the default branch might make sense, hence adding the "pushreq" and "pullreq" options

Actual Behavior

As per the request done on #384, the behavior enforces the pick up of cx.config from the default branch every time (push/PR/delete) and not just on deletion as most cases will be based on.
This means that, for example, if one pushes code or opens a PR on a branch that requires a different cx.config, for example, to set a filter to catch only Highs and send them to a bug-tracker, then that will not work and the filter-severity

Reproduction

  1. Execute CxFlow in web mode but add the use-config-as-code-from-default-branch: true option on the GitHub section.
  2. Set a cx.config with overriding properties on a feature branch and push the branch to one of the protected branches,
  3. Check if the overrides weren't applied to the project.

Environment Details

Windows 10, CxFlow 1,6,22

@cx-scord cx-scord added the bug Something isn't working label Aug 5, 2021
@jbrotsos jbrotsos self-assigned this Sep 23, 2021
@jbrotsos jbrotsos added this to the Parking Lot milestone Sep 23, 2021
@jbrotsos jbrotsos removed this from the Parking Lot milestone Mar 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants