Skip to content

Add parent_id and lock_permissions to reposition_channels #2238

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

Merged
merged 48 commits into from
Jul 9, 2025

Conversation

rayakame
Copy link
Member

@rayakame rayakame commented Mar 20, 2025

Summary

  • Move reposition_channels to special_endpoints without breaking/deprecating anything.
  • Add parent_id and lock_permissionsfor every channel.

Checklist

  • I have run nox and all the pipelines have passed.
  • I have made unittests according to the code I have added/modified/deleted.

Related issues

closes #523

@github-project-automation github-project-automation bot moved this to Ready to review in hikari development Mar 20, 2025
@davfsa davfsa moved this from Ready to review to In progress in hikari development Mar 20, 2025
@davfsa davfsa added the enhancement New feature or request label Mar 20, 2025
@rayakame
Copy link
Member Author

This should be the first Iteration of this feature.

Tests and docs are not done yet!
I want to clear up some things before I start working on these things.

  1. Naming
    I'm not really sure about the names yet. ChannelRepositioner doesn't sound right and same for RepositionChannelHelper .
    But i'm not creative at all and wanted to ask about your guys opinions.
  2. Implementation
    With the current implementation we wouldn't need to deprecate anything and there are no breaking changes. Only problem
    being that it could be pretty confusing since you can pass channels into the rest.reposition_channels and into the
    ChannelRepositioner. Normally I wouldn't say that this is important enough for a breaking change or a deprecation but we
    already have breaking changes planned for the next release so might as well do that.

Let me know about your opinions and I would be happy to implement them.

@null-domain null-domain moved this from In progress to Ready to review in hikari development Mar 21, 2025
@davfsa davfsa moved this from Ready to review to Changes requested in hikari development Mar 21, 2025
@rayakame
Copy link
Member Author

I will take a look in a hour or so

@rayakame rayakame moved this from Changes requested to Ready to review in hikari development May 2, 2025
rayakame added 7 commits May 2, 2025 16:45
Signed-off-by: Christopher <github.android206@passmail.net>
Added a reason parameter to the ChannelRepositioner class in order to provide
an explanation that will be recorded in the audit logs. (issue: feature/reposition-channels)
Copy link
Member

@davfsa davfsa left a comment

Choose a reason for hiding this comment

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

Only small things. Thanks for working on this!

@github-project-automation github-project-automation bot moved this from Ready to review to Changes requested in hikari development Jun 12, 2025
rayakame and others added 7 commits June 12, 2025 12:55
Co-authored-by: davfsa <davfsa@gmail.com>
Signed-off-by: Christopher <github.android206@passmail.net>
…tionedChannel in special_endpoints

Changed `RepositionChannelHelper` class to `RepositionedChannel` in special_endpoints.py
and api/special_endpoints.py files. (issue #feature/reposition-channels)
@rayakame rayakame moved this from Changes requested to Ready to review in hikari development Jun 22, 2025
@davfsa davfsa requested a review from Copilot July 9, 2025 08:35
davfsa
davfsa previously approved these changes Jul 9, 2025
@github-project-automation github-project-automation bot moved this from Ready to review to Done in hikari development Jul 9, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR moves reposition_channels into the special_endpoints builder pattern and adds support for parent_id and lock_permissions when repositioning channels.

  • Introduces ChannelRepositioner and RepositionedChannel implementations in hikari/impl/special_endpoints.py
  • Changes RESTClient.reposition_channels to return a repositioner builder instead of executing immediately
  • Updates API definitions, documentation, and tests to cover the new parameters

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
hikari/impl/special_endpoints.py Adds ChannelRepositioner and RepositionedChannel classes, including parent and lock_permissions support
hikari/impl/rest.py Modifies reposition_channels to return a builder with the new parameters
hikari/api/special_endpoints.py Defines abstract builder interfaces for channel repositioning
hikari/api/rest.py Updates abstract reposition_channels to return the builder and documents usage
tests/hikari/impl/test_special_endpoints.py Adds tests for the new builder methods and parameters
Comments suppressed due to low confidence (3)

hikari/impl/special_endpoints.py:303

  • The docstring references RepositionChannelHelper, but the abstract class is named RepositionedChannel. Please update the reference to match the class name.
class RepositionedChannel(special_endpoints.RepositionedChannel):

hikari/api/rest.py:5720

  • The parameter docs describe a mapping from channel to position, but the signature is Mapping[int, Channel] (position → channel). Please reconcile the description with the actual key/value ordering.
        positions

hikari/api/special_endpoints.py:234

  • The abstract add_reposition_channel requires lock_permissions and parent without defaults, but the implementation accepts undefined.UndefinedOr defaults. Consider making the API signature optional to match the implementation.
    def add_reposition_channel(

@davfsa davfsa merged commit 9a745c4 into hikari-py:master Jul 9, 2025
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add lock_permissions to reposition_channels
3 participants