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 source repo url information to standard parameters #1385

Merged
merged 1 commit into from
Aug 30, 2023

Conversation

savitaashture
Copy link
Member

Users can now use source_repo_url in pipelinerun template to get the information from which forked repo the event (Pull Request / Push) is coming from

Ex:

spec:
  params:
    - name: source_repo_url
      value: "{{ source_repo_url }}"      
  pipelineSpec:
    params:
      - name: source_repo_url  
  ...

Signed-off-by: Savita Ashture [email protected]"

Changes

Submitter Checklist

  • 📝 A good commit message is important for other reviewers to understand the context of your change. Please refer to How to Write a Git Commit Message for more details how to write beautiful commit messages. We rather have the commit message in the PR body and the commit message instead of an external website.
  • ♽ Run make test before submitting a PR (ie: with pre-commit, no need to waste CPU cycle on CI. (or even better install pre-commit and do pre-commit install in the root of this repo).
  • ✨ We heavily rely on linters to get our code clean and consistent, please ensure that you have run make lint before submitting a PR. The markdownlint error can get usually fixed by running make fix-markdownlint (make sure it's installed first)
  • 📖 If you are adding a user facing feature or make a change of the behavior, please verify that you have documented it
  • 🧪 100% coverage is not a target but most of the time we would rather have a unit test if you make a code change.
  • 🎁 If that's something that is possible to do please ensure to check if we can add a e2e test.
  • 🔎 If there is a flakiness in the CI tests then don't necessary ignore it, better get the flakyness fixed before merging or if that's not possible there is a good reason to bypass it. (token rate limitation may be a good reason to skip).

@codecov
Copy link

codecov bot commented Aug 24, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (557ccab) 60.97% compared to head (85881f2) 60.97%.
Report is 11 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1385   +/-   ##
=======================================
  Coverage   60.97%   60.97%           
=======================================
  Files         136      136           
  Lines        9934     9935    +1     
=======================================
+ Hits         6057     6058    +1     
  Misses       3392     3392           
  Partials      485      485           
Files Changed Coverage Δ
pkg/customparams/standard.go 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@chmouel
Copy link
Member

chmouel commented Aug 24, 2023

what happen on push ? should we have the same as target_url like we had on target_branch?

and let's make sure this would be documented with a test for it (push scenario).

@savitaashture
Copy link
Member Author

savitaashture commented Aug 25, 2023

@chmouel

what happen on push ? should we have the same as target_url like we had on target_branch?

Yes we do same like target_branch

I mean source and target URLs are same https://github.com/openshift-pipelines/pipelines-as-code/blob/main/pkg/provider/github/parse_payload.go#L246-L247

Actually we don't get the info of source URL directly in push i searched in Github docs

Or am i missing something here 🤔

Alternative way:

I did print push payload body https://gist.github.com/savitaashture/e1013de246b201ece565a86d7da96531 we get the data in bits of pieces we need to collect those in order to provide info of source_url and source_branch for push

let's make sure this would be documented

You mean here https://pipelinesascode.com/docs/guide/authoringprs/#authoring-pipelineruns-in-tekton-directory we need to add a clarification for those standard parameters or push and pull_request
right ?

with a test for it (push scenario).

You mean e2e ?

@savitaashture savitaashture force-pushed the add_source_url_info branch 5 times, most recently from 19cde72 to e7fefce Compare August 30, 2023 08:49
Copy link
Member

@chmouel chmouel 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, just some comments

docs/content/docs/guide/authoringprs.md Show resolved Hide resolved
test/gitea_test.go Outdated Show resolved Hide resolved
Users can now use source_repo_url in pipelinerun template to get the information from which forked repo the event (Pull Request / Push) is coming from

Signed-off-by: Savita Ashture <[email protected]>
@chmouel chmouel merged commit aa36883 into openshift-pipelines:main Aug 30, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants