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

SALTO-7067: add accountElements utility to Workspace #6963

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

tamtamirr
Copy link
Contributor

@tamtamirr tamtamirr commented Dec 17, 2024

Add accountElements utility to Workspace.


  • Moved useful implementations of ElementSources from core to adapter-utils.
  • Implemented a Workspace utility that returns elements for the provided account.

Release Notes:
Workspace:

  • Added method accountElements that returns ElementsSource of the provided account.

User Notifications:
None

@tamtamirr tamtamirr changed the title SALTO-7067: add accountElements utility to Workspace (DRAFT) SALTO-7067: add accountElements utility to Workspace Dec 17, 2024
@tamtamirr tamtamirr marked this pull request as ready for review December 17, 2024 19:51
@tamtamirr tamtamirr requested a review from a team December 17, 2024 19:51
@coveralls
Copy link

Coverage Status

coverage: 93.702% (-0.01%) from 93.713%
when pulling 1e7bf6c on tamtamirr:SALTO-7067
into eddc5c3 on salto-io:main.

@@ -185,6 +187,12 @@ export type Workspace = {
uid: string

elements: (includeHidden?: boolean, env?: string) => Promise<ElementsSource>
accountElements: (args: {
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the reasoning behind this being a new function and not another param to elements?

Copy link
Contributor Author

@tamtamirr tamtamirr Dec 18, 2024

Choose a reason for hiding this comment

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

I think it made sense to have a dedicated implementation for a specific account's ElementsSource, where the account name is a required parameter.
Also, while I could add more optional parameters to elements, I think this would make the elements method harder to use, especially since it doesn't use an object parameter, (and changing it to an object parameter would cause a breaking change).

Copy link
Contributor

@ori-moisis ori-moisis left a comment

Choose a reason for hiding this comment

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

I don't see a reason this should be added to the workspace interface
if this is part of a bigger plan, I would like to see what the bigger plan is and why this has to be a part of it

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.

4 participants