Skip to content

feat(backend): Add ReverseListOrderBlock for reversing list element order #10352

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

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

Swiftyos
Copy link
Contributor

Changes ๐Ÿ—๏ธ

This PR adds a new utility block to the basic blocks collection. This block provides a simple way to reverse the order of elements in any list.

New Features:

  • Added class in
  • Block accepts any list as input and returns the same list with elements in reversed order
  • Preserves the original list (creates a copy before reversing)
  • Works with lists containing any type of elements

Technical Details:

  • Block ID:
  • Category:
  • Input: - The list to reverse (accepts )
  • Output: - The list with elements in reversed order
  • Includes test input/output for validation

Checklist ๐Ÿ“‹

For code changes:

  • I have clearly listed my changes in the PR description
  • I have made a test plan
  • I have tested my changes according to the test plan:
    • Created an agent with the ReverseListOrderBlock
    • Tested with various list types (numbers, strings, mixed types)
    • Verified the block preserves the original list
    • Confirmed the block correctly reverses the order of elements
    • Tested with empty lists and single-element lists
    • Verified the block integrates properly with other blocks in a workflow

For configuration changes:

  • is updated or already compatible with my changes
  • is updated or already compatible with my changes
  • I have included a list of my configuration changes in the PR description (under Changes)

Note: No configuration changes required - this is a pure code addition that uses the existing block framework.

@Swiftyos Swiftyos requested a review from a team as a code owner July 11, 2025 09:43
@Swiftyos Swiftyos requested review from 0ubbe and majdyz and removed request for a team July 11, 2025 09:43
@github-project-automation github-project-automation bot moved this to ๐Ÿ†• Needs initial review in AutoGPT development kanban Jul 11, 2025
Copy link

netlify bot commented Jul 11, 2025

โœ… Deploy Preview for auto-gpt-docs-dev canceled.

Name Link
๐Ÿ”จ Latest commit 9a7aa43
๐Ÿ” Latest deploy log https://app.netlify.com/projects/auto-gpt-docs-dev/deploys/6874d97de1bad000082f1594

Copy link

PR Reviewer Guide ๐Ÿ”

Here are some key observations to aid the review process:

โฑ๏ธย Estimated effort to review: 2 ๐Ÿ”ต๐Ÿ”ตโšชโšชโšช
๐Ÿงชย No relevant tests
๐Ÿ”’ย No security concerns identified
โšกย Recommended focus areas for review

Missing Validation

The block doesn't validate that the input is actually a list. If a non-list value is passed, it could cause runtime errors or unexpected behavior when trying to reverse it.

async def run(self, input_data: Input, **kwargs) -> BlockOutput:
    reversed_list = list(input_data.input_list)
    reversed_list.reverse()
    yield "reversed_list", reversed_list

Copy link

netlify bot commented Jul 11, 2025

โœ… Deploy Preview for auto-gpt-docs canceled.

Name Link
๐Ÿ”จ Latest commit 9a7aa43
๐Ÿ” Latest deploy log https://app.netlify.com/projects/auto-gpt-docs/deploys/6874d97d27bc8f000867667a

Copy link

deepsource-io bot commented Jul 11, 2025

Here's the code health analysis summary for commits 6ffe57c..9a7aa43. View details on DeepSourceย โ†—.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource JavaScript LogoJavaScriptโœ…ย SuccessView Checkย โ†—
DeepSource Python LogoPythonโœ…ย SuccessView Checkย โ†—

๐Ÿ’ก If youโ€™re a repository administrator, you can configure the quality gates from the settings.


def __init__(self):
super().__init__(
id="422cb708-3109-4277-bfe3-bc2ae5812777",
Copy link
Contributor

Choose a reason for hiding this comment

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

is this real uuid?

@github-project-automation github-project-automation bot moved this from ๐Ÿ†• Needs initial review to ๐Ÿ‘๐Ÿผ Mergeable in AutoGPT development kanban Jul 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ๐Ÿ‘๐Ÿผ Mergeable
Development

Successfully merging this pull request may close these issues.

3 participants