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

feat: allow groups to be specified without a project #443

Merged
merged 1 commit into from
Jun 28, 2024
Merged

Conversation

maxrake
Copy link
Contributor

@maxrake maxrake commented Jun 28, 2024

This change allows users to specify a group without also specifying a corresponding project. Neither the project nor the group needs to exist beforehand. The group will now be created if it does not already exist.

This behavior is useful for those users with many projects and a desire to provide analysis results in the context of organizational groups. They can now specify a single CI configuration to use across the enterprise and everything will be named and created automatically and consistently.

Additionally, the values for project and group are now allowed to be "mixed" between what is specified on the command line and anything found in a .phylum_project file. This "mixing" was specifically denied previously but allowed now with a warning to let users know that may be an unexpected combination.

The group name is still optional and can be specified on the command line. It can also be specified in the .phylum_project file. The value specified with the option takes precedence when both are provided.

Other changes made include:

  • Update documentation
    • Add an example of using the --group option to each integration
    • Format the Jenkins groovy samples to use 2-space tabs instead of 4
  • Update .phylum_project file to use depfiles instead of lockfiles
  • Rename CLI exit code enum entry for group or project already existing
    • From PROJECT_ALREADY_EXISTS to ALREADY_EXISTS
  • Simplify some output messages
    • Use fewer words where possible
    • Be clear about when paid accounts are needed and provide info link

Testing

The changes in this branch are available in the maxrake/phylum-ci Docker image, with the mixed_groups tag.

Testing was performed locally, to include all the new combinations of project and group submissions. Screenshots and log output can be provided, if desired.

This change allows users to specify a group without also specifying a
corresponding project. Neither the project nor the group needs to exist
beforehand. The group will now be created if it does not already exist.

Additionally, the values for project and group are now allowed to be
"mixed" between what is specified on the command line and anything found
in a `.phylum_project` file. This "mixing" was specifically denied
previously but allowed now with a warning to let users know that may be
an unexpected combination.

The group name is still optional and can be specified on the command
line. It can also be specified in the `.phylum_project` file. The value
specified with the option takes precedence when both are provided.

Other changes made include:

* Update documentation
  * Add an example of using the `--group` option to each integration
  * Format the Jenkins groovy samples to use 2-space tabs instead of 4
* Update `.phylum_project` file to use `depfiles` instead of `lockfiles`
* Rename CLI exit code enum entry for group or project already existing
  * From `PROJECT_ALREADY_EXISTS` to `ALREADY_EXISTS`
* Simplify some output messages
  * Use fewer words where possible
  * Be clear about when paid accounts are needed and provide info link
@maxrake maxrake self-assigned this Jun 28, 2024
@maxrake maxrake requested a review from a team as a code owner June 28, 2024 20:20
@maxrake maxrake requested a review from cd-work June 28, 2024 20:20
@maxrake maxrake merged commit ec3bd63 into main Jun 28, 2024
13 checks passed
@maxrake maxrake deleted the mixed_groups branch June 28, 2024 20:27
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.

2 participants