Skip to content

Add a Datadog build step#88

Merged
FlorianVeaux merged 5 commits into
masterfrom
florian/options_step
Jul 27, 2020
Merged

Add a Datadog build step#88
FlorianVeaux merged 5 commits into
masterfrom
florian/options_step

Conversation

@FlorianVeaux

@FlorianVeaux FlorianVeaux commented Jul 2, 2020

Copy link
Copy Markdown
Contributor

Adding a pipeline compatible build steps in order to:

@FlorianVeaux FlorianVeaux added the do-not-merge/WIP Do not merge this PR label Jul 2, 2020
@FlorianVeaux
FlorianVeaux force-pushed the florian/options_step branch from a5f7360 to 55453e8 Compare July 17, 2020 15:45
@FlorianVeaux
FlorianVeaux marked this pull request as ready for review July 17, 2020 15:45
@FlorianVeaux FlorianVeaux added changelog/Added Added features results into a minor version bump do-not-merge/WIP Do not merge this PR and removed do-not-merge/WIP Do not merge this PR labels Jul 17, 2020

@sarah-witt sarah-witt 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.

Looks good so far! I'll manually test it soon. There should definitely be docs for this, though (they can be in a separate PR if it's a lot to add).

}
}
invoker.start();
return false;

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.

What is the return value used for here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ExtensionList.clearLegacyInstances();
cfg.setCollectBuildLogs(false);
EnvVars env = new EnvVars();
env.put("DD_TEST", "bar");

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.

What is this for? Shouldn't it not be needed for the integration test?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, can be removed totally. I was hesitating between putting the env var here or in the pipeline definition.

};
stubClient.assertMetric("jenkins.job.duration", hostname, expectedTags);
}
}

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 you add a test for multiple tags and setting collectLogs: false?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Extending the current one instead if that's ok

import org.kohsuke.stapler.DataBoundSetter;

/**
* Pipeline plug-in step for recording time-stamps.

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.

This doesn't seem accurate

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

oops

@FlorianVeaux FlorianVeaux removed the do-not-merge/WIP Do not merge this PR label Jul 21, 2020

@sarah-witt sarah-witt 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.

Looks great! One scenario I tested was creating a pipeline with multiple stages and adding new tags to only one stage, making sure only that stage had the new tags, which could be a good unit test.

@FlorianVeaux
FlorianVeaux merged commit 0e0bb10 into master Jul 27, 2020
@FlorianVeaux
FlorianVeaux deleted the florian/options_step branch July 27, 2020 08:51
@stpierre

Copy link
Copy Markdown

Is there any documentation on how to use this? I tried copying the examples from the unit tests but I get WorkflowScript: 27: Invalid option type "datadog". Valid option types: [...].

Happy to open an issue if that's the right course of action here.

@FlorianVeaux

Copy link
Copy Markdown
Contributor Author

Hey @stpierre
This has not been released yet, but we expect to release it sometime this week or the week after.
This page will get updated once done: https://plugins.jenkins.io/datadog/

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.

3 participants