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

feat: collect jenkins build parameters #7249

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

matrixji
Copy link
Member

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

@matrixji matrixji requested a review from abeizn March 29, 2024 04:29
Signed-off-by: Ji Bin <matrixji@live.com>
@klesh
Copy link
Contributor

klesh commented Apr 1, 2024

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.

@matrixji matrixji marked this pull request as draft April 1, 2024 04:17
@matrixji
Copy link
Member Author

matrixji commented Apr 1, 2024

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 parameters into 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 .*_Prod to 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=prod to match a production deployment.

I turned this PR as a draft, I'll try to provide the above 3 commits as a whole PR for this

@klesh
Copy link
Contributor

klesh commented Apr 1, 2024

Looking forward to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants