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

Migrate PullRequestResource to go-scm. #1521

Merged
merged 1 commit into from
Nov 9, 2019
Merged

Conversation

wlynch
Copy link
Member

@wlynch wlynch commented Nov 4, 2019

Changes

This changes the underlying implementation of the PullRequestResource
to jenkins-x/go-scm in order to take advantage of the repo drivers to
support other SCM providers.

In the process, this also allowed for refactoring to have a cleaner
distinction between interaction with SCM APIs and converting the data to
an on disk format.

BREAKING CHANGES:

  • go-scm does not yet support updating comments, so that behavior is
    removed for the time being since:
    1. it's unclear if anyone is actively
      using it.
    2. this behavior can be roughly replicated with a delete +
      create.
    3. the benefits of having the other SCM providers outweighs this
      feature.

Fixes #1066.

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

See the contribution guide for more details.

Double check this list of stuff that's easy to miss:

Reviewer Notes

If API changes are included, additive changes must be approved by at least two OWNERS and backwards incompatible changes must be approved by more than 50% of the OWNERS, and they must first be added in a backwards compatible way.

Release Notes

Updates Pull Request resource to use go-scm.

@googlebot googlebot added the cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit label Nov 4, 2019
@tekton-robot tekton-robot requested review from dlorenc and a user November 4, 2019 20:01
@tekton-robot tekton-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Nov 4, 2019
@wlynch
Copy link
Member Author

wlynch commented Nov 4, 2019

Tests will not build until jenkins-x/go-scm#49 is submitted.

@vdemeester
Copy link
Member

/hold

@tekton-robot tekton-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 5, 2019
Copy link
Member

@afrittoli afrittoli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this!
I'm still going through the review, one question I have is about comments, the commit message suggests they are not supported, however the PR includes code to handle them?

logger *zap.SugaredLogger
}

// NewHandler initializes a new handler for interacting with GitHub
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: with SCM resources?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Member Author

@wlynch wlynch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this!
I'm still going through the review, one question I have is about comments, the commit message suggests they are not supported, however the PR includes code to handle them?

That was carried over from the previous implementation. Changed the name of the method to better describe what it does.

@wlynch wlynch force-pushed the go-scm branch 3 times, most recently from 51249f3 to 0e1c21e Compare November 6, 2019 19:43
@wlynch
Copy link
Member Author

wlynch commented Nov 7, 2019

/hold cancel

All tests pass now, so removing the hold. @vdemeester if there was some other reason why you added the hold, feel free to reapply. =]

@tekton-robot tekton-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 7, 2019
@vdemeester
Copy link
Member

All tests pass now, so removing the hold. @vdemeester if there was some other reason why you added the hold, feel free to reapply. =]

I put the hold because of #1521 (comment) 👼

@wlynch
Copy link
Member Author

wlynch commented Nov 7, 2019

All tests pass now, so removing the hold. @vdemeester if there was some other reason why you added the hold, feel free to reapply. =]

I put the hold because of #1521 (comment)

Perfect! That's now resolved. ^_^

@wlynch wlynch requested a review from a user November 8, 2019 15:30
This changes the underlying implementation of the PullRequestResource
to jenkins-x/go-scm in order to take advantage of the repo drivers to
support other SCM providers.

In the process, this also allowed for refactoring to have a cleaner
distinction between interaction with SCM APIs and converting the data to
an on disk format.

BREAKING CHANGES:
* go-scm does not yet support updating comments, so that behavior is
removed for the time being since:
  1) it's unclear if anyone is actively
  using it.
  2) this behavior can be roughly replicated with a delete +
  create.
  3) the benefits of having the other SCM providers outweighs this
  feature.

Fixes tektoncd#1066.
@ghost
Copy link

ghost commented Nov 8, 2019

/lgtm

@tekton-robot tekton-robot assigned ghost Nov 8, 2019
@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 8, 2019
@dlorenc
Copy link
Contributor

dlorenc commented Nov 9, 2019

Awesome! I'll take a detailed look tomorrow!

1 similar comment
@dlorenc
Copy link
Contributor

dlorenc commented Nov 9, 2019

Awesome! I'll take a detailed look tomorrow!

@dlorenc
Copy link
Contributor

dlorenc commented Nov 9, 2019

/lgtm

Awesome!

@dlorenc
Copy link
Contributor

dlorenc commented Nov 9, 2019

/approve

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dlorenc

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 9, 2019
@tekton-robot tekton-robot merged commit 98dbc0b into tektoncd:master Nov 9, 2019
dlorenc added a commit to dlorenc/build-pipeline that referenced this pull request Nov 12, 2019
This was accidentally removed in tektoncd#1521. We desperately need to figure out
a story for running e2e tests that require auth secrets.
tekton-robot pushed a commit that referenced this pull request Nov 12, 2019
This was accidentally removed in #1521. We desperately need to figure out
a story for running e2e tests that require auth secrets.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

migrate the pullrequest-init code to go-scm to handle multiple git providers?
6 participants