Skip to content

Commit

Permalink
chore: remove the artifact upload limit from CLI side (#187)
Browse files Browse the repository at this point in the history
This limit is enforced on the server side.

Signed-off-by: Sourya Vatsyayan <sourya@deepsource.io>

Signed-off-by: Sourya Vatsyayan <sourya@deepsource.io>
  • Loading branch information
sourya-deepsource authored Oct 27, 2022
1 parent 7d9ac55 commit d3401b6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
3 changes: 1 addition & 2 deletions command/report/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,5 @@ Notes:
Documentation:
https://deepsource.io/docs/cli#report
`
reportGraphqlQuery = "mutation($input: CreateArtifactInput!) {\r\n createArtifact(input: $input) {\r\n ok\r\n error\r\n }\r\n}"
maxArtifactUploadSize = 20000000
reportGraphqlQuery = "mutation($input: CreateArtifactInput!) {\r\n createArtifact(input: $input) {\r\n ok\r\n error\r\n }\r\n}"
)
7 changes: 1 addition & 6 deletions command/report/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,18 +173,13 @@ func (opts *ReportOptions) Run() int {

if reportCommandValueFile != "" {
// Check file size
fileStat, err := os.Stat(reportCommandValueFile)
_, err := os.Stat(reportCommandValueFile)
if err != nil {
fmt.Println("DeepSource error | Error | Unable to read specified value file: " + reportCommandValueFile)
sentry.CaptureException(err)
return 1
}

if fileStat.Size() > maxArtifactUploadSize {
fmt.Println("DeepSource | Error | Value file too large. Should be less than 20 Megabytes")
return 1
}

valueBytes, err := ioutil.ReadFile(reportCommandValueFile)
if err != nil {
fmt.Println("DeepSource error| Error | Unable to read specified value file: ", reportCommandValueFile)
Expand Down

0 comments on commit d3401b6

Please sign in to comment.