Skip to content

Implement submitting in-progress pipelines data#387

Merged
nikita-tkachenko-datadog merged 11 commits into
masterfrom
nikita-tkachenko/in-progress-pipelines
Mar 4, 2024
Merged

Implement submitting in-progress pipelines data#387
nikita-tkachenko-datadog merged 11 commits into
masterfrom
nikita-tkachenko/in-progress-pipelines

Conversation

@nikita-tkachenko-datadog

Copy link
Copy Markdown
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?

Description of the Change

Alternate Designs

Possible Drawbacks

Verification Process

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 Jan 31, 2024
@nikita-tkachenko-datadog
nikita-tkachenko-datadog force-pushed the nikita-tkachenko/in-progress-pipelines branch from c6c5032 to 50ed31c Compare February 2, 2024 09:51
@nikita-tkachenko-datadog
nikita-tkachenko-datadog marked this pull request as ready for review February 27, 2024 19:05

@drodriguezhdez drodriguezhdez left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I dropped some minor comments, but in general LGTM

Comment thread src/main/java/org/datadog/jenkins/plugins/datadog/model/BuildData.java Outdated
Comment thread src/main/java/org/datadog/jenkins/plugins/datadog/model/BuildData.java Outdated
Comment on lines +200 to +209
// Set StartTime, EndTime and Duration
this.startTime = run.getStartTimeInMillis();
long durationInMs = run.getDuration();
if (durationInMs == 0 && startTime != 0) {
durationInMs = System.currentTimeMillis() - startTime;
}
this.duration = durationInMs;
if (duration != 0 && startTime != 0) {
this.endTime = startTime + duration;
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

As we discussed offline, the duration and endTime would be omitted if the pipeline is running in the backend. Could we add a comment here just mentioning this? It might be confusing if you think that the endTime is sent for real purpose when the pipeline is running.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Added the comment

Comment on lines +70 to +72
Long endTime = buildData.getEndTime(null);
// there are valid cases where endTime is null (in-progress pipelines), and the backend allows for this
if (endTime != null) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Could we use the isBuilding boolean instead of endTime to check if the pipeline is running or not?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Added isBuilding check

@nikita-tkachenko-datadog
nikita-tkachenko-datadog merged commit 3a508bf into master Mar 4, 2024
@nikita-tkachenko-datadog
nikita-tkachenko-datadog deleted the nikita-tkachenko/in-progress-pipelines branch March 4, 2024 13:28
nikita-tkachenko-datadog added a commit that referenced this pull request May 3, 2024
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants