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 owner flag #297

Closed
wants to merge 1 commit into from
Closed

Conversation

vitorsavian
Copy link
Member

Proposed Changes

  • Add a owner flag

Types of Changes

  • Command line

Testing

How to test:

1 - You can create a backport using the new flag -o

./backport -r k3s -o k3s-io -b 'release-1.21,release-1.22' -i 123

Linked Issues

User-Facing Change

Further Comments

I'm sending this PR because when I was trying to do backports this morning I was receiving a 404 when requesting the repo and it was missing the repo owner

Signed-off-by: Vitor <[email protected]>
Copy link
Contributor

@briandowns briandowns left a comment

Choose a reason for hiding this comment

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

Can you try rancher/rke2 or k3s-IO/k3s?

@vitorsavian
Copy link
Member Author

vitorsavian commented Nov 13, 2023

@briandowns I tried using this command here
./backport-linux-amd64 -r k3s-io/k3s -i 8033 -r 'release-1.25'
and I received
GET https://api.github.com/repos//k3s-io/k3s/issues/8033: 404 Not Found []

We could remove a / in this function if we don't wanna add another flag

func (s *IssuesService) Get(ctx context.Context, owner string, repo string, number int) (*Issue, *Response, error) {
	u := fmt.Sprintf("repos/%v/%v/issues/%d", owner, repo, number)
	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return nil, nil, err
	}

	// TODO: remove custom Accept header when this API fully launch.
	req.Header.Set("Accept", mediaTypeReactionsPreview)

	issue := new(Issue)
	resp, err := s.client.Do(ctx, req, issue)
	if err != nil {
		return nil, resp, err
	}

	return issue, resp, nil
}

@briandowns
Copy link
Contributor

Removing the slash is preferred. Should be done in the lib and not the binary. I can do this today if you want.

@vitorsavian
Copy link
Member Author

It doesn't need to be today, I've already done the backports with the -o flag. I will close the PR.

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.

2 participants