Skip to content

Fix StepData override in DatadogStepListener for Jenkins Pipelines traces#203

Merged
drodriguezhdez merged 1 commit into
masterfrom
drodriguezhdez/fix_step_information_overriden
Apr 22, 2021
Merged

Fix StepData override in DatadogStepListener for Jenkins Pipelines traces#203
drodriguezhdez merged 1 commit into
masterfrom
drodriguezhdez/fix_step_information_overriden

Conversation

@drodriguezhdez

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?

Using the DatadogStepListener class, we're collecting information associated with the actual Step is being executed at that moment, such as environment variables, node name, etc.. in a StepData instance. Every StepData instance is kept in a map that will be accessed at the end of the pipeline execution to create the trace.

Currently, the key of the map is based on the StepDescriptor, but Jenkins is reusing the same descriptor for different steps (e.g. the step descriptor of the step representing the Git checkout is the same across the pipeline execution).

This PR changes the key of the map to use the FlowNode IDs, which are uniques during a certain Run.

Description of the Change

The StepData map uses the FlowNode id (unique) instead of the StepDescriptor in the DatadogStepListener class.

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.

@drodriguezhdez drodriguezhdez added the changelog/Fixed Fixed features results into a bug fix version bump label Apr 22, 2021

@FlorianVeaux FlorianVeaux 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.

Looks good. Good catch with that, I also assumed that the StepDescriptor was unique for a step.

@drodriguezhdez
drodriguezhdez merged commit c45e9fb into master Apr 22, 2021
@drodriguezhdez
drodriguezhdez deleted the drodriguezhdez/fix_step_information_overriden branch April 22, 2021 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/Fixed Fixed features results into a bug fix version bump

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants