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

Define and document the TAR and zip structure for data sections #1163

Closed
de-jcup opened this issue Mar 24, 2022 · 1 comment · Fixed by #1313
Closed

Define and document the TAR and zip structure for data sections #1163

de-jcup opened this issue Mar 24, 2022 · 1 comment · Fixed by #1313

Comments

@de-jcup
Copy link
Member

de-jcup commented Mar 24, 2022

Situation

This is (not only) a sub issue of #1166

When #1154 and #1098 are implemented a user is able to upload multiple binaries, sources etc. give them names and reference the files/folders inside
the sechub configuration file

But doing this, we must

Wanted

  • documentation
  • clear definition how the structure inside tars and zips looks like

Solution

General Definition

We map the JSON model into the file system by using always following path pattern:

/__data__/$storageDataType/$dataObjectName/$originPath
  • $storageDataType can be sources or binaries (like in JSON)
  • $dataObjectName is just the name defined inside JSON for the data section
  • $originPath represents the origin path from file system

Examples

  • look at the next comments for examples

Next steps

Implement

@de-jcup de-jcup self-assigned this Mar 24, 2022
@de-jcup de-jcup added this to the Server 0.30.0 milestone Mar 24, 2022
@de-jcup
Copy link
Member Author

de-jcup commented Mar 24, 2022

Example 1

The JSON looks like:

{
  "apiVersion" : "1.0",
  "data" : {
    "sources" : [ {
      "name" : "open-api-file-reference",
      "fileystem" : {
        "files" : [ "gamechanger-webapp/src/main/resources/openapi3.json" ]
      }
    } ]
  },
  "codeScan" : {
    "fileSystem" : {
      "folders" : [ "gamechanger-android/src/main/java", "gamechanger-server/src/main/java" ]
    },
    "excludes" : [ "**/mytestcode/**", "**/documentation/**" ],
    "additionalFilenameExtensions" : [ ".cplusplus", ".py9" ],
    "uses" : [ "open-api-file-reference"]
  },
  "webScan" : {
    "openApi" : {
      "uses" : [ "open-api-file-reference" ]
    },
    "uri" : "https://productfailure.demo.example.org"
  }
}

All of those parts do contain sources and will be combined inside sourcecode.zip which is uploaded only ONE time.

The resulting zip file will have following content:

/__data__/sources/open-api-file-reference/gamechanger-webapp/src/main/resources/openapi3.json
/gamechanger-android/src/main/java
/gamechanger-server/src/main/java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants