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 Datadog build step #88

Merged
merged 5 commits into from
Jul 27, 2020
Merged

Add a Datadog build step #88

merged 5 commits into from
Jul 27, 2020

Conversation

FlorianVeaux
Copy link
Contributor

@FlorianVeaux FlorianVeaux commented Jul 2, 2020

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 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
Copy link
Collaborator

@sarah-witt sarah-witt left a comment

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
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
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
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
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
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
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
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
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
Copy link
Collaborator

@sarah-witt sarah-witt left a comment

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

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
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