-
Notifications
You must be signed in to change notification settings - Fork 179
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 command to create a release group release #1409
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code is looking good.
I'd like to see a more thorough test plan, though. The test plan only tests with one project being added to the release group and does not test any of the failure cases. I.e. it would be good to test what happens if you try to create a release group while missing the --project-branch
flag. It would also be good to specifically test with multiple projects being added.
We should also test the delete command that was added in this PR
## Example | ||
|
||
```bash | ||
fossa release-group create-release --title example-release-group --release example-release --project-locator custom+1/example --project-revision 1234 --project-branch main --project-locator custom+1/example2 --project-revision 5678 --project-branch main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should explicitly document that you can have mulitple groups of project-locator
, project-revision
and project-branch
args, and that the sets of args are grouped together based on their order.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was able to create a new release group with a branch that did not exist. Is this a bug or is it expected?
fossa release-group create-release --title "Test release group" --release example-release-title-3 --project-locator custom+24987/2779 --project-revision 1625011087 --project-branch master --project-locator custom+24987/4361-repro --project-revision 1657063285 --project-branch does-not-exist
This successfully created the release. You can see it here on the scottpatten.ca org: https://app.fossa.com/projects/group/1396/projects
When I click through on the "4361-repro" project, I see a "Branch does not exist" error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was able to create a new release group with a branch that did not exist. Is this a bug or is it expected?
This is expected behavior, I brought it up with Core and filed a ticket: https://fossa.atlassian.net/browse/CORE-3155
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should explicitly document that you can have multiple groups of
project-locator
,project-revision
andproject-branch
args, and that the sets of args are grouped together based on their order.
Good point, I can see this being confusing to readers. There documentation on how those 3 flags are grouped together here and documentation on providing multiple instances of these flags here. It's all kind of spread apart so I can write a consolidate blurb as well as adding context on the grouping order.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whoa.... all those locator-specific args are required? is there no way to match strings and just create a release called example-release
within an existing example-release-group
? (I realize I'm probably oversimplifying) cc @vishal-thenge
It seems like if fossa analyze --release-group-name 'MY_RG' --release-group-release 'MY_RELEASE'
is possible, we should also decouple creating releases and release groups from project locators, revisions, and branches.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JeffreyHuynh1 makes sense, although conceptually I can't understand why releases are inherently tied to projects instead of standalone containers. I guess that's why empty releases can't exist, which CORE-3189 was proposed to fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ryanlink 100% . When Core has implemented a way to support empty releases, we will be able to remove the requirement of having a project added to a release in the CLI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ryanlink by "match strings" do you mean infer the revision and project name that the user wants to add to the release group?
At the very least we have to offer a way for a user to create a release group with all of these flags, but maybe there's a way we can make it easier for users who have analyzed a project recently.
I'm not sure if this is possible or if we want to do this, but what about a flag like --most-recently-analyzed-revision
that pulls the local data from the last time fossa analyze
was run to populate --revision
and --locator
. Would that solve what you're looking for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you mean infer the revision and project name that the user wants to add to the release group?
no, I meant in the case where they just want to create a new release version within an RG for subsequent use in a fossa analyze
command... but wasn't thinking about the fact that you can't currently create an empty release in the core app.
however, this does support Nexthink's request for fossa analyze --release-group-name XXX -release-group-release ZZZ
to create the release ZZZ
within the RG if it doesn't already exist.
@JeffreyHuynh1 copying here from Slack - can we add this reference to the docs?
You can run
fossa analyze --json
and get the data you need https://github.com/fossas/fossa-cli/blob/master/docs/references/subcommands/analyze.md#printing-project-metadata (project locator, etc.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and this may be out of scope for this PR, but echoing @vishal-thenge 's request:
if we only have a
projectLocator
; but not:projectRevision
&projectBranch
tofossa release-group
; can we add support to default them to the i) default branch & ii) latest revision ?
The delete command was added in prior a PR. We have tests for it here: https://github.com/fossas/fossa-cli/blob/master/test/App/Fossa/ReleaseGroup/DeleteSpec.hs |
I was suggesting a more detailed manual testing plan. Sorry for the confusion :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This all looks good to me!
I added one optional comment on the docs, but nothing blocking
Overview
The CLI should offer a way to create release group release from the command line
Acceptance criteria
Testing plan
example .fossa.yml:
Create a release group release:
fossa release-group create-release --title example-title --release example-release-title --project-locator custom+1/git@github.com/example --project-revision 12345 --project-branch main
fossa release-group create-release -c /path/to/.fossa.yml/
Risks
Metrics
References
Checklist
docs/
.docs/README.ms
and gave consideration to how discoverable or not my documentation is.Changelog.md
. If this PR did not mark a release, I added my changes into an# Unreleased
section at the top..fossa.yml
orfossa-deps.{json.yml}
, I updateddocs/references/files/*.schema.json
AND I have updated example files used byfossa init
command. You may also need to update these if you have added/removed new dependency type (e.g.pip
) or analysis target type (e.g.poetry
).docs/references/subcommands/<subcommand>.md
.