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

orchestrator(GHActions): align GetJobURL method with Piper's expectations #4685

Merged
merged 10 commits into from
Nov 27, 2023

Conversation

vstarostin
Copy link
Member

@vstarostin vstarostin commented Nov 21, 2023

Changes

The GetJobURL (and GetBuildURL) functions are (particularly) used by the telemetry package to populate the PipelineURLHash and BuildURLHash.

The expected value of the PipelineURLHash is a URL (hashed value) that points to the project’s pipelines.
The expected value of the BuildURLHash is a URL (hashed value) that points to all pipelines of the currently running workflow. Not a particular stage.

Therefore, we don't need a GitHub API call to obtain a job (piper stage) URL. We need the workflow URL, which can be accessed from GitHub environment variables.

Related: SAP/project-piper-action#161

  • Tests
  • Documentation

@vstarostin vstarostin marked this pull request as ready for review November 21, 2023 09:58
@vstarostin vstarostin requested review from Googlom and a team November 21, 2023 09:59
@vstarostin vstarostin requested a review from inf2381 as a code owner November 21, 2023 10:02
@vstarostin
Copy link
Member Author

/it-go

return g.currentJob.HtmlURL
fileName := workflowFileName()
if fileName == "" {
return ""
Copy link
Member Author

@vstarostin vstarostin Nov 27, 2023

Choose a reason for hiding this comment

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

if there is something wrong with GITHUB_WORKFLOW_REF, the GetJobURL returns an empty string, then the telemetry package handles it and put n/a to the PipelineURLHash, so that we know that something wrong

@vstarostin vstarostin requested a review from CCFenner November 27, 2023 09:58
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@vstarostin
Copy link
Member Author

/it-go

@vstarostin vstarostin merged commit c6c02fc into master Nov 27, 2023
@vstarostin vstarostin deleted the vstarostin/splunk branch November 27, 2023 11:04
maxatsap pushed a commit to maxatsap/jenkins-library that referenced this pull request Jul 23, 2024
…ions (SAP#4685)

* Align build and job urls with what is expected by piper

* Add comments, delete unused func

* Clean up

* Update tests

* Update GetJobURL

* Fix test

* Update

* Clean up
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.

3 participants