feat: collect jenkins build parameters
Summary
Collet jenkins build parameters into raw data.
Does this close any open issues?
It may helpful for #6000 if someone continue working based on this PR.
Screenshots
N/A
Other Information
Out current idea is collect build parameter into raw data, then we using dbt or some external scripts to fix the environment field in cicd_deployment_commmits table
Hi, @matrixji , I see we are collecting more information from the API with this patch. Seems like you have the whole plan of achieving what you wanted, would you like to share it as a document on the website so others could also learn the idea? Or I am afraid it is too subtle for others to understand how to do so.
I have a similar requirement with #6000. In our use of Jenkins, we use the parameter to specify which env to deploy, e.g. devploy_env="prod" as Production deployment, while deploy_env="test" as the QA deployment.
Currently in the DORA metrics process, while doing data transformation from jenkinsBuild to jenkinsTask/jenkinsPipeline, it just uses Jenkins Jobs' name to decide which environment is used. So my plan to support this requirement may be split into below steps:
- Collect the
parametersinto raw data - Add parameters as string field into
JenkinsBuild, this may rebuild kv pairs as a string: k1=v1;k2=v2;k3=v3 - In the transformation step, besides deciding if this job is a production env, also check the parameters(maybe matched with {name}~{parameters}):
- Right now, the job name needs to be set as Deploy_Foo_Service_Prod, we use the pattern
.*_Prodto match a production deployment. - After this is done, we could use the job name Deploy_Foo_Service with the parameter deploy_env=prod, we could set the pattern as
deploy_env=prodto match a production deployment.
- Right now, the job name needs to be set as Deploy_Foo_Service_Prod, we use the pattern
I turned this PR as a draft, I'll try to provide the above 3 commits as a whole PR for this
Looking forward to it.
This pull request has been automatically marked as stale because it has not had recent activity for 120 days. It will be closed in 7 days if no further activity occurs.
This pull request has been closed because it has not had recent activity. You could reopen it if you try to continue your work, and anyone who are interested in it are encouraged to continue work on this pull request.