chore: add ci pipline job in global report#8825
Merged
Merged
Conversation
Signed-off-by: Olblak <me@olblak.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds CI pipeline metadata (name and URL) to each pipeline's report so reports can show where Updatecli was executed. CI detection reuses the existing pkg/plugins/utils/ci helper.
Changes:
- Introduce a
CIDatastruct andCIfield onReport. - Add
Report.UpdateCIJob()to populate CI info viaci.New(). - Call
UpdateCIJob()for each pipeline beforeUpdateID()in the engine run loop.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| pkg/core/reports/report.go | Adds CIData type, CI field on Report, and UpdateCIJob method that detects CI via ci.New(). |
| pkg/core/engine/run.go | Invokes UpdateCIJob for each pipeline and logs failures at debug level. |
Comments suppressed due to low confidence (1)
pkg/core/reports/report.go:150
ci.New()never returns(nil, nil): when no CI environment is detected it returns(nil, fmt.Errorf("unknown CI Engine"))(see pkg/plugins/utils/ci/main.go:31). Consequently theif detectedCi == nilbranch here is unreachable, andUpdateCIJobwill always return an "unknown CI Engine" error when Updatecli is run outside a supported CI, causing a misleading debug log lineupdating CI job information: unknown CI Engineon every local run. The non-CI case should be treated as a normal "not detected" outcome (e.g., return nil without an error, or detect this sentinel error and swallow it) rather than being reported as a failure.
func (r *Report) UpdateCIJob() error {
detectedCi, err := ci.New()
if err != nil {
return err
}
if detectedCi == nil {
// No CI pipeline detected
return nil
}
r.CI = CIData{
Name: detectedCi.Name(),
URL: detectedCi.URL(),
}
return nil
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Olblak <me@olblak.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Show ci job url where Updatecli was executed directly in the report data
Test
Tested manually
Additional Information
Checklist
Tradeoff
Potential improvement