这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@allisoneer
Copy link
Contributor

@allisoneer allisoneer commented May 14, 2025

Important

Add support for automatic namespace creation in agent and task creation, with updated RBAC and tests.

  • Behavior:
    • createAgent and createTask in server.go now ensure the namespace exists before proceeding.
    • Adds ensureNamespaceExists function to check and create namespaces if needed.
  • RBAC:
    • Adds namespace_permissions_patch.yaml and namespace_permissions_binding.yaml for namespace management permissions.
    • Updates kustomization.yaml to include new RBAC files.
  • Tests:
    • Adds tests in server_test.go for namespace auto-creation and error handling during namespace creation.

This description was created by Ellipsis for a0393a2. You can customize this summary. It will automatically update as commits are pushed.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Caution

Changes requested ❌

Reviewed everything up to a0393a2 in 1 minute and 35 seconds. Click for details.
  • Reviewed 382 lines of code in 5 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. acp/config/rbac/namespace_permissions_binding.yaml:13
  • Draft comment:
    Consider adding a newline at the end of the file for consistency.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% While having a newline at the end of files is a common convention, this is a very minor formatting issue. It's the kind of thing that should be handled by automated tooling or git configuration, not manual code review comments. It doesn't affect functionality and is not a significant code quality issue. Missing newlines at end of files can cause issues with some tools and make diffs less clean. It's a widely accepted best practice to include them. While true, this is too minor an issue for a PR comment. It should be handled by automated formatting tools or git configuration, not manual review. Delete this comment as it's too minor an issue and should be handled by automated tooling rather than manual review comments.
2. acp/config/rbac/namespace_permissions_patch.yaml:14
  • Draft comment:
    Consider adding a newline at the end of the file for consistency.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% While having a newline at the end of files is a common convention, this is a very minor stylistic issue. Most modern editors handle this automatically. This kind of comment doesn't point out a functional issue or code quality problem that meaningfully impacts the codebase. Missing newlines at end of file can cause issues with some tools and make diffs less clean. It's a widely accepted best practice in software development. While true, this is such a minor issue that it doesn't warrant a PR comment. Most CI systems or pre-commit hooks would catch this if it was important to the team. Delete this comment as it's too minor of an issue to warrant a PR comment and would likely be handled by automated tools if the team cares about it.
3. acp/internal/server/server_test.go:406
  • Draft comment:
    The custom errorK8sClient simulates errors for namespace GETs; ensure this simulation is scoped only to namespace objects so that other resource tests are not inadvertently affected.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment is suggesting to ensure that the error simulation is scoped correctly. This is asking the author to ensure something, which violates the rules. It doesn't provide a specific suggestion or ask for a specific test to be written.

Workflow ID: wflow_CDppyYm2RmnpUkq0

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

},
}

if err := s.client.Create(ctx, &namespace); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

When creating the namespace, consider handling an AlreadyExists error (e.g. using apierrors.IsAlreadyExists) to account for concurrent namespace creation.

@balanceiskey balanceiskey merged commit e7144a2 into humanlayer:main May 14, 2025
3 of 4 checks passed
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