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

✨ Task report files #577

Merged
merged 19 commits into from
Dec 19, 2023
Merged

✨ Task report files #577

merged 19 commits into from
Dec 19, 2023

Conversation

jortel
Copy link
Contributor

@jortel jortel commented Dec 13, 2023

Add support for:

  • TaskReport attached files. The addon (and tackle2-addon command) can attach files with command output and/or log files.
  • File API to support creating empty files.
  • File API to support append content - PATCH /files/:id.
  • Addon (adapter) to support attach files to the task report.

Reaper updated to support fields with array of refs. New tag ref=[]file

Example:

 - '[CMD] Running: /usr/bin/konveyor-analyzer --provider-settings /addon/opt/settings.json --output-file /addon/report.yaml --no-dependency-rules --rules /addon/rules/rulesets/1/rules --rules /addon/rules/rulesets/24/rules --rules /addon/rules/rulesets/20/rules --label-selector konveyor.io/target=cloud-readiness --dep-label-selector !konveyor.io/dep-source=open-source'
    - '[CMD] /usr/bin/konveyor-analyzer succeeded.'
    - '[CMD] Running: /usr/bin/konveyor-analyzer-dep --provider-settings /addon/opt/settings.json --output-file /addon/deps.yaml'
    - '[CMD] /usr/bin/konveyor-analyzer-dep succeeded.'
    - 'Analysis reported. duration: 102.5784ms'
    - '[TAG] Tagging Application 4.'
    - Facts updated.
    - Done.
attached:
    - id: 989
      name: konveyor-analyzer.output
      activity: 44
    - id: 991
      name: konveyor-analyzer-dep.output
      activity: 50

migration/v12/model/core.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@mansam mansam left a comment

Choose a reason for hiding this comment

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

Looks good, just a few comments

api/task.go Outdated Show resolved Hide resolved
Reader: bytes.NewReader([]byte{}),
},
}
err = r.FileSend(path, http.MethodPut, fields, object)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like this should be http.MethodPost

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

"gorm.io/gorm"
)

var log = logr.WithName("migration|v11")
Copy link
Collaborator

Choose a reason for hiding this comment

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

the log name should be migration|v12

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.
We may want to correct this in the tooling.

Signed-off-by: Jeff Ortel <[email protected]>
Signed-off-by: Jeff Ortel <[email protected]>
Signed-off-by: Jeff Ortel <[email protected]>
Signed-off-by: Jeff Ortel <[email protected]>
Signed-off-by: Jeff Ortel <[email protected]>
Signed-off-by: Jeff Ortel <[email protected]>
Signed-off-by: Jeff Ortel <[email protected]>
Signed-off-by: Jeff Ortel <[email protected]>
Signed-off-by: Jeff Ortel <[email protected]>
Signed-off-by: Jeff Ortel <[email protected]>
Signed-off-by: Jeff Ortel <[email protected]>
Signed-off-by: Jeff Ortel <[email protected]>
Signed-off-by: Jeff Ortel <[email protected]>
Signed-off-by: Jeff Ortel <[email protected]>
Signed-off-by: Jeff Ortel <[email protected]>
Signed-off-by: Jeff Ortel <[email protected]>
Signed-off-by: Jeff Ortel <[email protected]>
Signed-off-by: Jeff Ortel <[email protected]>
Copy link
Collaborator

@mansam mansam left a comment

Choose a reason for hiding this comment

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

LGTM

@jortel jortel merged commit f09d0b2 into konveyor:main Dec 19, 2023
11 checks passed
jortel added a commit to konveyor/tackle2-addon that referenced this pull request Dec 19, 2023
Add command reporting verbosity. This is intended to better support
troubleshooting.
Mainly, the support for level=_LiveOutput_. This _streams_ command
output to files attached to the task report.

The output reporting is rate-limited using a _backoff_ algorithm. 

Add command `New` _constructor_ and update the repository package to use
it.

**Requires**: konveyor/tackle2-hub#577

Example:
```
 - '[CMD] Running: /usr/bin/konveyor-analyzer --provider-settings /addon/opt/settings.json --output-file /addon/report.yaml --no-dependency-rules --rules /addon/rules/rulesets/1/rules --rules /addon/rules/rulesets/24/rules --rules /addon/rules/rulesets/20/rules --label-selector konveyor.io/target=cloud-readiness --dep-label-selector !konveyor.io/dep-source=open-source'
    - '[CMD] /usr/bin/konveyor-analyzer succeeded.'
    - '[CMD] Running: /usr/bin/konveyor-analyzer-dep --provider-settings /addon/opt/settings.json --output-file /addon/deps.yaml'
    - '[CMD] /usr/bin/konveyor-analyzer-dep succeeded.'
    - 'Analysis reported. duration: 102.5784ms'
    - '[TAG] Tagging Application 4.'
    - Facts updated.
    - Done.
attached:
    - id: 989
      name: konveyor-analyzer.output
      activity: 44
    - id: 991
      name: konveyor-analyzer-dep.output
      activity: 50
```

---------

Signed-off-by: Jeff Ortel <[email protected]>
jortel added a commit to konveyor/tackle2-addon-analyzer that referenced this pull request Dec 19, 2023
Add support for verbosity. This mainly applies to reporting in task
activity.

When requested, the command output is included (live) in the activity
log. This provides more detail and better insight into what the command
is doing _currently_.

Requires:
- konveyor/tackle2-hub#577
- konveyor/tackle2-addon#50

---------

Signed-off-by: Jeff Ortel <[email protected]>
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