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

fossa upload-project command #639

Merged
merged 7 commits into from Jan 14, 2021
Merged

fossa upload-project command #639

merged 7 commits into from Jan 14, 2021

Conversation

zlav
Copy link
Member

@zlav zlav commented Dec 18, 2020

Description

Add support for a fossa upload-project command that is intended to behave identically to the UI archive scanning feature.

This PR also adds support to assign a project to a release group version from the CLI by supplying --release-group <name> and --release-group-version <version> to the command.

Example UI:

fossa upload-project temp --title new-title --release-group test --release-group-version 2.0
============================================================

    FOSSA Reports:
    https://app.fossa.com/projects/archive+testing%2F/refs/%2Ffossa-archive/6b15f78939019bba6ead53cd2d3a4b8d

============================================================

Notes

I considered using one flag and splitting on a special character such as --release-group <name>@<version> but I decided to implement two separate flags. The main reason is to avoid unintended issues with splitting the strings on the backend and disallowing a certain special character. The second reason is to reduce confusion for the user who needs to manually add the character. I am favoring enforcing explicit declaration over the expense of the command looking a bit messy.

@zlav zlav changed the title Fossa command Fossa archive command Dec 18, 2020
@zlav zlav changed the title Fossa archive command Fossa archive upload command Dec 18, 2020
@codecov
Copy link

codecov bot commented Dec 18, 2020

Codecov Report

Merging #639 (9e96019) into master (38fdbac) will decrease coverage by 0.34%.
The diff coverage is 2.94%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #639      +/-   ##
==========================================
- Coverage   48.76%   48.41%   -0.35%     
==========================================
  Files         117      117              
  Lines        6398     6446      +48     
==========================================
+ Hits         3120     3121       +1     
- Misses       2970     3016      +46     
- Partials      308      309       +1     
Impacted Files Coverage Δ
api/fossa/tar.go 10.11% <0.00%> (-1.55%) ⬇️
api/fossa/upload.go 0.00% <0.00%> (ø)
cmd/fossa/flags/flags.go 78.94% <ø> (ø)
cmd/fossa/main.go 0.00% <ø> (ø)
config/file.go 35.48% <0.00%> (-1.19%) ⬇️
config/keys.go 51.11% <0.00%> (-1.17%) ⬇️
api/fossa/locator.go 59.75% <28.57%> (-3.41%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 38fdbac...9e96019. Read the comment docs.

@zlav zlav requested a review from elldritch January 4, 2021 20:04
@zlav zlav changed the title Fossa archive upload command fossa upload-project command Jan 8, 2021
@zlav zlav requested review from elldritch and removed request for elldritch January 8, 2021 06:46
Copy link
Member

@elldritch elldritch left a comment

Choose a reason for hiding this comment

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

LGTM. Some comments. Non-blocking due to urgency - please respond before merging, but don't feel like you need to block on a re-approval before merge.

api/fossa/locator.go Show resolved Hide resolved
api/fossa/tar.go Outdated Show resolved Hide resolved
api/fossa/tar.go Outdated Show resolved Hide resolved
config/file.v1/file.go Show resolved Hide resolved
cmd/fossa/cmd/upload_project/upload_project.go Outdated Show resolved Hide resolved
@zlav zlav merged commit 89b8691 into master Jan 14, 2021
@zlav zlav deleted the feat/fossa-archive branch January 14, 2021 07:37
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.

None yet

2 participants