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

feat: aws integration: UI facing QS api for cloud account management #6771

Merged
merged 39 commits into from
Jan 10, 2025

Conversation

raj-k-singh
Copy link
Collaborator

@raj-k-singh raj-k-singh commented Jan 8, 2025

Summary

Adds Query Service APIs for powering AWS integrations UI

Related Issues / PR's

Contributes to #6544


Important

Add AWS cloud account management API to Query Service with new routes, controllers, models, and tests.

  • API and Routes:
    • Added RegisterCloudIntegrationsRoutes in http_handler.go to handle AWS cloud account management.
    • New routes for generating connection URLs, listing accounts, checking account status, updating config, disconnecting accounts, and agent check-ins.
  • Controllers:
    • Introduced CloudIntegrationsController in controller.go for managing cloud accounts.
    • Functions include ListConnectedAccounts, GenerateConnectionUrl, GetAccountStatus, CheckInAsAgent, UpdateAccountConfig, and DisconnectAccount.
  • Models and Repositories:
    • Added AccountRecord, AccountConfig, AgentReport in model.go.
    • Implemented cloudProviderAccountsSQLRepository in repo.go for database operations.
  • Server and Initialization:
    • Integrated CloudIntegrationsController in server.go during server initialization.
  • Tests:
    • Added integration tests in signoz_cloud_integrations_test.go to verify AWS integration lifecycle.
  • Miscellaneous:
    • Updated NewTestSqliteDB in testutils.go for testing purposes.

This description was created by Ellipsis for 35e1027. It will automatically update as commits are pushed.

@github-actions github-actions bot added docs required enhancement New feature or request labels Jan 8, 2025
@raj-k-singh raj-k-singh force-pushed the feat/aws-integration-ui-facing-api-0 branch 2 times, most recently from 202bc43 to 7d576aa Compare January 9, 2025 04:22
@raj-k-singh raj-k-singh force-pushed the feat/aws-integration-ui-facing-api-0 branch from 7d576aa to 5e1246b Compare January 9, 2025 04:23
@raj-k-singh raj-k-singh marked this pull request as ready for review January 9, 2025 04:23
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.

👍 Looks good to me! Reviewed everything up to 5e1246b in 1 minute and 53 seconds

More details
  • Looked at 1390 lines of code in 11 files
  • Skipped 0 files when reviewing.
  • Skipped posting 6 drafted comments based on config settings.
1. pkg/query-service/utils/testutils.go:19
  • Draft comment:
    Consider checking the error returned by os.Remove in the cleanup function to ensure the temporary file is successfully deleted. This will help avoid leftover files in the system.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The function NewTestSqliteDB creates a temporary SQLite database for testing purposes. However, it does not handle the case where the temporary file cannot be removed during cleanup. This could lead to leftover files in the system.
2. pkg/query-service/utils/testutils.go:33
  • Draft comment:
    The TODO comment suggests that passing the DB file path should not be necessary. Consider refactoring the code to eliminate the need for passing the DB file path to dao.InitDao and dashboards.InitDB.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The NewQueryServiceDBForTests function initializes the DAO and dashboards with the test database file path. However, the TODO comment suggests that passing the DB file path should not be necessary. This indicates a potential area for improvement in the codebase.
3. pkg/query-service/app/cloudintegrations/controller.go:1
  • Draft comment:
    Avoid using the component/index.tsx file structure approach, as it makes it difficult to debug and find components using global search tools like VS Code. This is applicable in other files as well.
  • Reason this comment was not posted:
    Comment was on unchanged code.
4. pkg/query-service/app/cloudintegrations/repo.go:1
  • Draft comment:
    Avoid using the component/index.tsx file structure approach, as it makes it difficult to debug and find components using global search tools like VS Code. This is applicable in other files as well.
  • Reason this comment was not posted:
    Marked as duplicate.
5. pkg/query-service/app/cloudintegrations/model.go:1
  • Draft comment:
    Avoid using the component/index.tsx file structure approach, as it makes it difficult to debug and find components using global search tools like VS Code. This is applicable in other files as well.
  • Reason this comment was not posted:
    Marked as duplicate.
6. pkg/query-service/app/cloudintegrations/controller_test.go:1
  • Draft comment:
    Avoid using the component/index.tsx file structure approach, as it makes it difficult to debug and find components using global search tools like VS Code. This is applicable in other files as well.
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_wjestgZYRSegDlj2


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

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.

👍 Looks good to me! Incremental review on 26bd4e3 in 34 seconds

More details
  • Looked at 56 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 4 drafted comments based on config settings.
1. pkg/query-service/app/cloudintegrations/controller.go:227
  • Draft comment:
    The error message 'couldn't disconnect account' is appropriate here as it aligns with the operation being performed.
  • Reason this comment was not posted:
    Confidence changes required: 10%
    The error message in the DisconnectAccount function should be consistent with the operation being performed. The current message 'couldn't disconnect account' is appropriate for the context of the operation.
2. pkg/query-service/app/cloudintegrations/controller.go:235
  • Draft comment:
    The error message 'couldn't disconnect account' is appropriate here as it aligns with the operation being performed.
  • Reason this comment was not posted:
    Confidence changes required: 10%
    The error message in the DisconnectAccount function should be consistent with the operation being performed. The current message 'couldn't disconnect account' is appropriate for the context of the operation.
3. pkg/query-service/app/cloudintegrations/controller_test.go:99
  • Draft comment:
    The test correctly checks for an error when disconnecting a non-existent account. The assertions are appropriate.
  • Reason this comment was not posted:
    Confidence changes required: 10%
    The test function TestCantDisconnectNonExistentAccount is correctly checking for the error when trying to disconnect a non-existent account. The assertions are appropriate and ensure the function behaves as expected.
4. pkg/query-service/app/cloudintegrations/controller.go:222
  • Draft comment:
    Avoid using inline styles. Use external stylesheets, CSS classes, or styled components instead. This is also applicable in other parts of the code where inline styles are used.
  • Reason this comment was not posted:
    Comment was not on a valid diff hunk.

Workflow ID: wflow_DkNLsRrpyLyU4I9I


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

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.

👍 Looks good to me! Incremental review on 2ff511e in 1 minute and 26 seconds

More details
  • Looked at 59 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. pkg/query-service/app/cloudintegrations/controller_test.go:125
  • Draft comment:
    The test case TestAgentCheckIns was updated to expect apiErr to be nil after a successful check-in, which aligns with the changes in the CheckInAsAgent function. This is a correct change.
  • Reason this comment was not posted:
    Confidence changes required: 20%
    The test case TestAgentCheckIns was modified to expect apiErr to be nil after a successful check-in, which aligns with the changes in the CheckInAsAgent function. This is a correct change, but it should be noted for clarity.

Workflow ID: wflow_gtGjfF3MjgAtKKTF


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

srikanthccv
srikanthccv previously approved these changes Jan 9, 2025
@srikanthccv
Copy link
Member

@raj-k-singh please check the ee references in MIT licensed code error

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.

👍 Looks good to me! Incremental review on 35e1027 in 24 seconds

More details
  • Looked at 13 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_3QvIQ6Zt6jFLa23z


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@raj-k-singh
Copy link
Collaborator Author

@raj-k-singh please check the ee references in MIT licensed code error

@srikanthccv it was a mistaken import of ee/model instead of pkg/model by the IDE. Please take a look and approve again

@raj-k-singh raj-k-singh merged commit d5b847c into main Jan 10, 2025
17 of 18 checks passed
@raj-k-singh raj-k-singh deleted the feat/aws-integration-ui-facing-api-0 branch January 10, 2025 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs required enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants