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

Use 'line' instead of 'position' #1566

Merged

Conversation

tick-taku
Copy link
Contributor

Resolves #1565


Behavior

Before the change?

After the change?

  • Use 'line' instead of 'position'.

Other information

  • I changed to specify parameters required for multiline comments, such as 'start_line', in the 'options'.

Additional info

Pull request checklist

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • Added the appropriate label for the given change

Does this introduce a breaking change?

Please see our docs on breaking changes to help!

  • Yes (Please add the Type: Breaking change label)
  • No

If Yes, what's the impact:

  • N/A

Pull request type

Please add the corresponding label for change this PR introduces:

  • Bugfix: Type: Bug
  • Feature/model/API additions: Type: Feature
  • Updates to docs or samples: Type: Documentation
  • Dependencies/code cleanup: Type: Maintenance

@kfcampbell
Copy link
Member

I've approved the Actions runs; thank you for submitting! I'm slightly torn about this: I think this is a breaking change since the signature of create_pull_request_comment is changing. Would it be better to provide an override or mark the current method as deprecated first and then remove it entirely in a new major version after?

@tick-taku
Copy link
Contributor Author

Well...You're right! It may not be possible to provide an override because we're just changing the parameter name, and the type remains the same. So I think we have no choice but to release it in the next major version.
In terms of just using it, you can still use it as is since the type remains the same, and it's not using keyword arguments.
What do you think would be a good course of action?

@kfcampbell
Copy link
Member

Hmm...I'm not loving any of these options, really. Perhaps the best thing to do is note in comments/docs that "position" will go away in favor of "line" in the next major version, and save this PR up for when we cut a new major version.

@tick-taku
Copy link
Contributor Author

I see, understood! Thanks!
We will put it on hold until the next major version. I will submit a Pull Request with the additional comments.

@kfcampbell kfcampbell added Priority: Normal Status: Blocked Some technical or requirement is blocking the issue Type: Breaking change Used to note any change that requires a major version bump labels Jun 26, 2023
@halorgium
Copy link

halorgium commented Jul 26, 2023

Would you consider adding an interim method which uses the new API request format?
In theory, the interim method could become an alias in the next major version.

Continuing to use the position parameter seems to result in the side parameter to behave incorrectly (every comment associates with the left-hand side).

By adopting the line parameter, the functionality behaves as expected.

My workaround is to call directly into the API:

octokit.post(
  "#{Octokit::Repository.path("user/repo")}/pulls/#{pull_id}/comments",
  {
    body: body,
    commit_id: commit_id,
    path: path,
    line: line,
    side: 'RIGHT'
  }
)

@kfcampbell
Copy link
Member

When we merge #1596, we can/should also take this PR before cutting a breaking change.

@nickfloyd nickfloyd added Type: Maintenance Any dependency, housekeeping, and clean up Issue or PR and removed Status: Blocked Some technical or requirement is blocking the issue labels Oct 16, 2023
Copy link
Member

@kfcampbell kfcampbell left a comment

Choose a reason for hiding this comment

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

I think the deprecation notice has been baking long enough and we can release this breaking change now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Breaking change Used to note any change that requires a major version bump Type: Maintenance Any dependency, housekeeping, and clean up Issue or PR
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[FEAT]: Add support line property to create_pull_request_comment
4 participants