Skip to content

chore: add ci pipline job in global report#8825

Merged
olblak merged 2 commits into
updatecli:mainfrom
olblak:chore/reorg/cijob
May 16, 2026
Merged

chore: add ci pipline job in global report#8825
olblak merged 2 commits into
updatecli:mainfrom
olblak:chore/reorg/cijob

Conversation

@olblak

@olblak olblak commented May 16, 2026

Copy link
Copy Markdown
Member

Show ci job url where Updatecli was executed directly in the report data

Test

Tested manually

Additional Information

Checklist

  • I have updated the documentation via pull request in website repository.

Tradeoff

Potential improvement

Signed-off-by: Olblak <me@olblak.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 CIData struct and CI field on Report.
  • Add Report.UpdateCIJob() to populate CI info via ci.New().
  • Call UpdateCIJob() for each pipeline before UpdateID() 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 the if detectedCi == nil branch here is unreachable, and UpdateCIJob will always return an "unknown CI Engine" error when Updatecli is run outside a supported CI, causing a misleading debug log line updating CI job information: unknown CI Engine on 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.

Comment thread pkg/core/reports/report.go Outdated
Comment thread pkg/core/engine/run.go
Signed-off-by: Olblak <me@olblak.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread pkg/core/reports/report.go
@olblak olblak enabled auto-merge (squash) May 16, 2026 12:25
@olblak olblak merged commit 687d99c into updatecli:main May 16, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants