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

Add a link to Datadog to job details page #447

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

nikita-tkachenko-datadog
Copy link
Collaborator

Requirements for Contributing to this repository

  • Fill out the template below. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • The pull request must only fix one issue at the time.
  • The pull request must update the test suite to demonstrate the changed functionality.
  • After you create the pull request, all status checks must be pass before a maintainer reviews your contribution. For more details, please see CONTRIBUTING.

What does this PR do?

If CI Visibility is enabled, adds a "View in Datadog" link to the details page of every traced job.

Description of the Change

Alternate Designs

Possible Drawbacks

Verification Process

Tested manually.

Additional Notes

Release Notes

Review checklist (to be filled by reviewers)

  • Feature or bug fix MUST have appropriate tests (unit, integration, etc...)
  • PR title must be written as a CHANGELOG entry (see why)
  • Files changes must correspond to the primary purpose of the PR as described in the title (small unrelated changes should have their own PR)
  • PR must have one changelog/ label attached. If applicable it should have the backward-incompatible label attached.
  • PR should not have do-not-merge/ label attached.
  • If Applicable, issue must have kind/ and severity/ labels attached at least.

@nikita-tkachenko-datadog nikita-tkachenko-datadog added the changelog/Added Added features results into a minor version bump label Sep 16, 2024
@nikita-tkachenko-datadog nikita-tkachenko-datadog marked this pull request as ready for review September 16, 2024 14:08
Copy link
Collaborator

@drodriguezhdez drodriguezhdez left a comment

Choose a reason for hiding this comment

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

Requested changes as the link does not take into account the datacenter region. (Host is different between them)

public DatadogLinkAction(BuildData buildData) { // ci.pipeline.url%3A"https%3A%2F%2Fgoogle.com"
String query = String.format("ci_level:pipeline @ci.pipeline.name:\"%s\" @ci.pipeline.number:%s", buildData.getJobName(), buildData.getBuildNumber(""));
String urlEncodedQuery = URLEncoder.encode(query, StandardCharsets.UTF_8);
this.url = String.format("https://app.datadoghq.com/ci/pipeline-executions?query=%s", urlEncodedQuery);
Copy link
Collaborator

Choose a reason for hiding this comment

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

The host will be different depending on the datacenter and/or, if the org has custom subdomains.
E.g. For orgs in Europe, the url is https://app.datadoghq.eu/........., etc.

This is typically resolved by asking customer to provide a DD_SITE environment variable (this does not cover custom subdomains, tho). For Jenkins, this does not seem the best approach, as it has its own config page.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I know it's the case when using the intakes, but is it the same when logging in to the UI though? I thought for the app the URL is always the same, as in the static docs we have https://app.datadoghq.com hardcoded.
I might be wrong though, will try asking someone who knows

@nikita-tkachenko-datadog nikita-tkachenko-datadog force-pushed the nikita-tkachenko/add-datadog-link branch from 9bf640e to 490a0c7 Compare September 19, 2024 17:03
@github-actions github-actions bot added the documentation Documentation related changes label Sep 19, 2024
@nikita-tkachenko-datadog nikita-tkachenko-datadog changed the base branch from master to nikita-tkachenko/configuration-refactoring-updated September 19, 2024 17:03
@@ -218,6 +236,17 @@
return FormValidation.ok("Success!");
}

@RequirePOST
public ListBoxModel doFillSiteItems() {

Check warning

Code scanning / Jenkins Security Scan

Stapler: Missing permission check Warning

Potential missing permission check in DatadogAgentConfigurationDescriptor#doFillSiteItems
@nikita-tkachenko-datadog nikita-tkachenko-datadog marked this pull request as draft September 23, 2024 14:00
@nikita-tkachenko-datadog nikita-tkachenko-datadog force-pushed the nikita-tkachenko/configuration-refactoring-updated branch from 5f3a210 to d20b98e Compare October 11, 2024 11:01
@nikita-tkachenko-datadog nikita-tkachenko-datadog force-pushed the nikita-tkachenko/configuration-refactoring-updated branch from d20b98e to b8e26e6 Compare November 20, 2024 10:03
@nikita-tkachenko-datadog nikita-tkachenko-datadog force-pushed the nikita-tkachenko/configuration-refactoring-updated branch 2 times, most recently from 0404aa5 to 0260867 Compare December 5, 2024 15:55
Base automatically changed from nikita-tkachenko/configuration-refactoring-updated to master December 11, 2024 09:53
@nikita-tkachenko-datadog nikita-tkachenko-datadog force-pushed the nikita-tkachenko/add-datadog-link branch from 490a0c7 to 0277c0d Compare December 18, 2024 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog/Added Added features results into a minor version bump documentation Documentation related changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants