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 Filter for a specific pull request #72

Closed
wants to merge 3 commits into from

Conversation

roryp2
Copy link

@roryp2 roryp2 commented Jan 25, 2019

We need to be able to only build specific PRs in our pipelines and so need to be able to specify which PR number we want to build version for.

If you provide a pr option within the source configuration of your resource then only commits for that PR will be returned from the check task.

@roryp2 roryp2 requested a review from itsdalmo as a code owner January 25, 2019 12:22
@itsdalmo
Copy link
Contributor

Hi and thanks for the PR @roryp2!

Tying the resource to a specific PR number seems a bit brittle, and I'm wondering if we could find a more generic solution if you explain a bit more about your use case?

@roryp2
Copy link
Author

roryp2 commented Jan 25, 2019

Sure, so for each PR that we raise we spin up a new pipeline dynamically for it so that it is isolated and changes to the pipeline can be tested within PRs and then that pipeline is destroyed when the PR is close. So in our case we would not want any other PRs being built within that pipeline.

@itsdalmo
Copy link
Contributor

Sure, so for each PR that we raise we spin up a new pipeline dynamically for it so that it is isolated and changes to the pipeline can be tested within PRs and then that pipeline is destroyed when the PR is close. So in our case we would not want any other PRs being built within that pipeline.

Sounds like perhaps it would make sense to generate the pipeline and use the git-resource instead of github-pr-resource to track commits to the branch that the PR was opened from? Or do you intend to build off forks as well?

@roryp2
Copy link
Author

roryp2 commented Jan 29, 2019

We use the pr resource mainly just for the status checks. Potentially we could just recreate the status checks as a separate resource and use the git-resource for the src itself.

@Typositoire
Copy link

We're also looking for this, until Spaces are GA this sounds like the best approach to avoid PR not building because of race condition.

@Typositoire
Copy link

Typositoire commented Feb 1, 2019

Also there's things you can't do off branches directly. Like commenting etc. I've been testing @roryp2 's branch all day and it works well.

@Typositoire
Copy link

Typositoire commented Feb 7, 2019

Small update, I did another patch on top of yours for my needs, dunno how useful it is for others but basically we started hitting this: #26

So I added a mode to track ONLY pr numbers. So the first pipeline creates inputs if p.number > request.Version.PR and the second pipeline (that tracks a PR) continues to use the committedDate. This is basically Spaces Pre-Alpha xD

If others are interested I can submit a PR along side this one.

@Typositoire
Copy link

Any hopes to see this merged? I've been running this PR for more than a month without issues if that can comfort @itsdalmo :p

@itsdalmo
Copy link
Contributor

itsdalmo commented Apr 2, 2019

Hey, sorry for the long radio silence on this one. Been thinking a bit on the use case, and it seems to me like what you really want is a resource which tracks when a (specific) PR is opened/closed, which is somewhat different problem from what this resource solves. As such I believe the PR filter belongs in another resource, perhaps the one discussed in #71?

Thanks again for the PR!

@itsdalmo itsdalmo closed this Apr 2, 2019
@Typositoire
Copy link

Sorry but not really. Until spaces arrive, this is the only way to manage PR on big project without skipping updates. I need this resource to track ONLY updates on 1 specific PR and I create one pipeline per PR. I did create a resource to track PR being opened. But I still need this feature. Can we schedule something to show you what I use it for and maybe make you change your mind? @itsdalmo

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

3 participants