Enable CI Visibility UI#221
Conversation
Co-authored-by: Fernando Mayo <[email protected]>
Co-authored-by: Fernando Mayo <[email protected]>
AdrianLC
left a comment
There was a problem hiding this comment.
I think I found some mistake on logging otherwise looks good.
It'd be good to have some tests for the logic in the form.
| if(!enableCiVisibility || DatadogClient.ClientType.DSD.name().equals(this.reportWith)) { | ||
| this.collectBuildTraces = enableCiVisibility; | ||
| } else { | ||
| logger.warning("CI Visibility can only be enabled using Datadog Agent mode."); |
There was a problem hiding this comment.
It seems this would warn if users set the env var DATADOG_JENKINS_PLUGIN_ENABLE_CI_VISIBILITY to False? Is that a bug?
There was a problem hiding this comment.
Hummm, no... The warning is shown when:
enableCiVisibility == true && DatadogClient.ClientType.HTTP.name().equals(this.reportWith)
I'm going to change the condition to be clearer.
| // NOTE: Change this when APM Traces was released as public feature. | ||
| this.setTraceServiceName(DEFAULT_TRACES_SERVICE_NAME); | ||
| this.setEnableCiVisibility(ciVisibilityData != null && !ciVisibilityData.isNullObject()); | ||
| } catch (Exception ex) { |
There was a problem hiding this comment.
would this log a severe error when you raise throw new FormException("CI Visibility can only be enabled using Datadog Agent mode.", "collectBuildTraces")? that seems like a mistake
There was a problem hiding this comment.
If we cannot parse the configuration, it's an error and we should log it as an error IMHO. If we cannot parse the configuration is not an expected behaviour
There was a problem hiding this comment.
yes but you're also throwing a validation exception in this block and that's not an error in parsing
There was a problem hiding this comment.
Oh, you're totally right. Good catch.
Co-authored-by: Adrián López Calvo <[email protected]>
Co-authored-by: Fernando Mayo <[email protected]>
Co-authored-by: Fernando Mayo <[email protected]>
Yeah, I agree. However, I think we cannot execute unit tests with this logic, but integration tests. We'd need to take a deeper look at how to do it because this configuration does not have any tests yet (even before CI Visibility). I've tested these changes in real Jenkins instances, so I think we can go forward, unblock the UI, and then we can invest some time into automatize these integration tests. |
Co-authored-by: Fernando Mayo <[email protected]>
| | Global job tags | A comma separated list of regex to match a job and a list of tags to apply to that job. Tags can include environment variables that are defined in the master jenkins instance. **Note**: Tags can reference match groups in the regex using the `$` symbol, for example: `(.*?)_job_(*?)_release, owner:$1, release_env:$2, optional:Tag3` | `DATADOG_JENKINS_PLUGIN_GLOBAL_JOB_TAGS` | | ||
| | Send security audit events | Submits the `Security Events Type` of events and metrics (enabled by default). | `DATADOG_JENKINS_PLUGIN_EMIT_SECURITY_EVENTS` | | ||
| | Send system events | Submits the `System Events Type` of events and metrics (enabled by default). | `DATADOG_JENKINS_PLUGIN_EMIT_SYSTEM_EVENTS` | | ||
| | Enable Log Collection | Collect and Submit build logs (disabled by default). | `DATADOG_JENKINS_PLUGIN_COLLECT_BUILD_LOGS` | |
There was a problem hiding this comment.
Why are you removing this ?
There was a problem hiding this comment.
We're not removing this, but moving to another place in the README. These envvars are related to the Advanced tab, where the "Enable Log Collection" is not there anymore.
Requirements for Contributing to this repository
What does this PR do?
This PR enables the configuration for
CI Visibilityvia UI and environment variables:DATADOG_JENKINS_PLUGIN_TARGET_TRACE_COLLECTION_PORTDATADOG_JENKINS_PLUGIN_ENABLE_CI_VISIBILITYDATADOG_JENKINS_PLUGIN_CI_VISIBILITY_CI_INSTANCE_NAME.Additionally, the PR adds some changes to the current UI to accommodate the CI Visibility feature in a coherent way for the user.
Datadog Agentinstead ofDogStatsDin the applicable context.Finally, this PR modifies the
README.mddocument to include the new configuration setup forCI Visibility.Description of the Change
Alternate Designs
Possible Drawbacks
Verification Process
Additional Notes
Release Notes
Review checklist (to be filled by reviewers)
changelog/label attached. If applicable it should have thebackward-incompatiblelabel attached.do-not-merge/label attached.kind/andseverity/labels attached at least.