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

Update API Token from the UI #2198

Merged
merged 5 commits into from
Jan 13, 2025
Merged

Update API Token from the UI #2198

merged 5 commits into from
Jan 13, 2025

Conversation

BenElferink
Copy link
Contributor

@BenElferink BenElferink commented Jan 12, 2025

This pull request includes multiple changes aimed at improving code maintainability and functionality across several files. The most significant changes involve adding a new lint-fix target to the Makefile, refactoring the cli/cmd/describe.go file to use constants, and updating the frontend/graph/generated.go file to include a new mutation for updating API tokens.

Makefile improvements:

  • Added a lint-fix target to the Makefile to allow automatic fixing of linting issues for the common and k8sutils modules.

CLI command refactoring:

  • Refactored cli/cmd/describe.go to use constants from k8sconsts for service names and ports, improving code readability and maintainability. [1] [2] [3] [4]
  • Updated cli/cmd/pro.go to include a new flag updateRemoteFlag and refactored the token update logic to use a remote update function if the flag is set. [1] [2]

Frontend GraphQL schema updates:

Miscellaneous updates:

  • Updated cli/cmd/resources/ui.go to use constants from k8sconsts for service names and ports, ensuring consistency across the codebase. [1] [2]

AvihuHenya and others added 2 commits January 12, 2025 14:33
declaring remote flag in cli pro command for enabling update token via
Odigos ui

---------

Co-authored-by: Ben Elferink <ben.elferink@icloud.com>
@BenElferink BenElferink marked this pull request as draft January 12, 2025 12:48
@BenElferink BenElferink changed the title feat: cli remote update token Update API Token from the UI Jan 12, 2025
This pull request includes several changes to the `cli` and `frontend`
components of the project. The modifications primarily focus on updating
API tokens and restructuring the GraphQL schema and resolver methods.

### CLI Changes:
* **Import Order Fixes:** Reordered imports in `cli/cmd/pro.go` to
follow the standard convention.
* **Function Signature Update:** Modified the `executeRemoteUpdateToken`
function to include an additional `onPremToken` parameter.
[[1]](diffhunk://#diff-433dfb4fa2ecc9c2fe6e9a0996b24b5c205837c86b9201767e7f4956e98b41a5L36-R37)
[[2]](diffhunk://#diff-433dfb4fa2ecc9c2fe6e9a0996b24b5c205837c86b9201767e7f4956e98b41a5L52-R54)

### Frontend Changes:
* **GraphQL Schema Updates:**
* Added `UpdateAPIToken` complexity function to the `ComplexityRoot`
struct.
* Introduced `UpdateAPIToken` method in the `MutationResolver`
interface.

* **GraphQL Resolver Methods:**
* Implemented `UpdateAPIToken` resolver method and its associated
context and arguments handling.
[[1]](diffhunk://#diff-4bacf1f13939a5c243f3f83d21f4560b331d13667d81ea5945ed1f57ddb205f2R1677-R1688)
[[2]](diffhunk://#diff-4bacf1f13939a5c243f3f83d21f4560b331d13667d81ea5945ed1f57ddb205f2R2832-R2846)
[[3]](diffhunk://#diff-4bacf1f13939a5c243f3f83d21f4560b331d13667d81ea5945ed1f57ddb205f2L9733-R9763)
[[4]](diffhunk://#diff-4bacf1f13939a5c243f3f83d21f4560b331d13667d81ea5945ed1f57ddb205f2L9747-R9776)
[[5]](diffhunk://#diff-4bacf1f13939a5c243f3f83d21f4560b331d13667d81ea5945ed1f57ddb205f2L9759-R9800)
[[6]](diffhunk://#diff-4bacf1f13939a5c243f3f83d21f4560b331d13667d81ea5945ed1f57ddb205f2L9797-R9810)
[[7]](diffhunk://#diff-4bacf1f13939a5c243f3f83d21f4560b331d13667d81ea5945ed1f57ddb205f2L9914-R9928)
* Reverted changes to the `TestConnectionForDestination` resolver method
and restored it to its original position.
[[1]](diffhunk://#diff-4bacf1f13939a5c243f3f83d21f4560b331d13667d81ea5945ed1f57ddb205f2R10179-R10245)
[[2]](diffhunk://#diff-4bacf1f13939a5c243f3f83d21f4560b331d13667d81ea5945ed1f57ddb205f2L20246-R20332)

These changes aim to enhance the functionality and maintainability of
the codebase by improving token management and ensuring consistency in
GraphQL operations.
@BenElferink BenElferink marked this pull request as ready for review January 12, 2025 15:24
@BenElferink BenElferink added enhancement New feature or request frontend labels Jan 12, 2025
@BenElferink BenElferink requested review from alonkeyval and blumamir and removed request for alonkeyval January 12, 2025 15:25
Copy link

Update Token

@BenElferink BenElferink merged commit 3611a3b into main Jan 13, 2025
32 of 33 checks passed
@BenElferink BenElferink deleted the feature/token-crud-ui branch January 13, 2025 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request frontend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants