Skip to content

Conversation

@prkhrkat
Copy link
Contributor

@prkhrkat prkhrkat commented Jul 28, 2025

Description

Fixes https://github.com/devtron-labs/sprint-tasks/issues/2425

Checklist:

  • The title of the PR states what changed and the related issues number (used for the release note).
  • Does this PR requires documentation updates?
  • I've updated documentation as required by this PR.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have tested it for all user roles.
  • I have added all the required unit/api test cases.

Does this PR introduce a user-facing change?


Summary by Bito

This pull request introduces a new endpoint for fetching clusters by IDs with supporting service functions, improves error handling, and enriches workflow metadata with cluster identifiers. It updates API specifications and Swagger documentation while refining build and dependency injection scripts to streamline integration.

@github-actions
Copy link

Some linked issues are invalid. Please update the issue links:\nIssue # in is not found or invalid (HTTP 404).\n

@github-actions
Copy link

Some linked issues are invalid. Please update the issue links:\nIssue # in is not found or invalid (HTTP 404).\n

@bito-code-review
Copy link

Changelist by Bito

This pull request implements the following key changes.

Key Change Files Impacted
New Feature - Introduction of New Cluster Retrieval Endpoints and Support Functions

ClusterRestHandler.go - Added a new FindByIds endpoint, refactored import statements, and improved error handling for cluster connectivity.

ClusterRouter.go - Introduced a new router path with query parameters to support the FindByIds API.

ClusterService.go - Implemented a FindByIdsWithoutConfig function and defined a cluster connectivity error constant to support the new API.

ClusterServiceExtended.go - Added a wrapper for FindByIdsWithoutConfig to enhance cluster service functionality in extended contexts.

Feature Improvement - Enhancement of Workflow Stage Metadata and Environment Integration

WorkflowStageStatusService.go - Enhanced pod stage metadata by including clusterId and integrated the environment repository for more precise workflow status reporting.

Documentation - API Specification and Example Updates for Consistency

cluster_api_spec.yaml - Updated the clusterId query parameter’s description and example for clearer API usage.

openapi.yaml - Revised parameter details and examples for cluster filtering to improve schema consistency.

workflow-stage-status.internal.yaml - Modified example payload and property naming (from 'ClusterID' to 'clusterId') for consistent metadata representation.

Other Improvements - Refinements in Build Scripts and Dependency Injection Configurations

wire_gen.go - Revised the go:generate command to include proper module flag for dependency management.

wire_gen.go - Updated dependency injection parameters in the workflow stage status service instantiation to ensure smoother integration.

Copy link

@bito-code-review bito-code-review bot left a comment

Choose a reason for hiding this comment

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

Code Review Agent Run #401b39

Actionable Suggestions - 2
  • api/cluster/ClusterRestHandler.go - 1
    • Incorrect error handling in success response · Line 351-351
  • specs/cluster_api_spec.yaml - 1
    • Conflicting API parameter definitions · Line 52-52
Review Details
  • Files reviewed - 10 · Commit Range: 0ba77cc..a181225
    • api/cluster/ClusterRestHandler.go
    • api/cluster/ClusterRouter.go
    • cmd/external-app/wire_gen.go
    • pkg/cluster/ClusterService.go
    • pkg/cluster/ClusterServiceExtended.go
    • pkg/pipeline/workflowStatus/WorkflowStageStatusService.go
    • specs/cluster_api_spec.yaml
    • specs/swagger/openapi.yaml
    • specs/workflow/workflow-stage-status.internal.yaml
    • wire_gen.go
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Default Agent You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@bito-code-review
Copy link

Bito Banner

Bito's AI Code Review trial is almost over

Your free trial of Bito's AI Code Reviews was setup by [email protected] and is nearly over. Let them know if you'd like to continue getting complete reviews.

Sign in to upgrade

About Bito
Merge PRs 89% faster, with 34% fewer regressions, and 87% of relevant PR feedback provided by Bito's AI Code Reviews. Trusted by 100,000+ developers and 1,000+ engineering teams.

@github-actions
Copy link

Some linked issues are invalid. Please update the issue links:\nIssue # in is not found or invalid (HTTP 404).\n

@github-actions
Copy link

Some linked issues are invalid. Please update the issue links:\nIssue # in is not found or invalid (HTTP 404).\n

@bito-code-review
Copy link

bito-code-review bot commented Jul 28, 2025

Bito Review Skipped - No Changes Detected

Bito didn't review this pull request because we did not detect any changes in the pull request to review.

@bito-code-review
Copy link

Bito Banner

Bito's AI Code Review trial is almost over

Your free trial of Bito's AI Code Reviews was setup by [email protected] and is nearly over. Let them know if you'd like to continue getting complete reviews.

Sign in to upgrade

About Bito
Merge PRs 89% faster, with 34% fewer regressions, and 87% of relevant PR feedback provided by Bito's AI Code Reviews. Trusted by 100,000+ developers and 1,000+ engineering teams.

@prkhrkat prkhrkat changed the title Api changes pod misc: Api changes for env enhancement Jul 28, 2025
@prkhrkat prkhrkat merged commit 28bd893 into develop Jul 28, 2025
4 checks passed
@prkhrkat prkhrkat deleted the api-changes-pod branch July 28, 2025 11:57
@sonarqubecloud
Copy link

@bito-code-review
Copy link

bito-code-review bot commented Jul 28, 2025

Bito Review Skipped - Source Branch Not Found

Bito didn’t review this change because the pull request is no longer valid. It may have been merged, or the source/target branch may no longer exist.

@bito-code-review
Copy link

Bito Banner

Bito's AI Code Review trial is almost over

Your free trial of Bito's AI Code Reviews was setup by [email protected] and is nearly over. Let them know if you'd like to continue getting complete reviews.

Sign in to upgrade

About Bito
Merge PRs 89% faster, with 34% fewer regressions, and 87% of relevant PR feedback provided by Bito's AI Code Reviews. Trusted by 100,000+ developers and 1,000+ engineering teams.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants