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

ADCM-6125 Configuration management #17

Merged
merged 17 commits into from
Nov 29, 2024
Merged

ADCM-6125 Configuration management #17

merged 17 commits into from
Nov 29, 2024

Conversation

Sealwing
Copy link
Collaborator

No description provided.

@Sealwing Sealwing marked this pull request as ready for review November 26, 2024 11:52
@Sealwing Sealwing requested a review from a-alferov as a code owner November 27, 2024 09:26
adcm_aio_client/core/config/_objects.py Show resolved Hide resolved
adcm_aio_client/core/config/types.py Show resolved Hide resolved
adcm_aio_client/core/config/_objects.py Outdated Show resolved Hide resolved
tests/unit/test_config.py Outdated Show resolved Hide resolved
a-alferov
a-alferov previously approved these changes Nov 28, 2024
version: 1.0

config:
- name: root_int
Copy link
Member

Choose a reason for hiding this comment

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

what about usage of structure (list and dict)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

more complex example, will try it with real ADCM

return wrapper


class Value[T](_ConfigWrapper):
Copy link
Member

Choose a reason for hiding this comment

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

seems ValueWrapper was more complimentary, or maybe something like class Parameter or ConfigParameter? cause it will be strange that Value class has also value property.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ValueWrapper is a bit long to use it for typehints, but if you insist, I can rename (see Desyncable also)

Parameter isn't the value, it's something like description of value (Value doesn't have name for now, for example)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

on second thought, Parameter may be a good term, let me think about it

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You are right, we can introduce term Parameter, because later we will most likely have schema associated with it alongside the value (description, type properties, etc.)

So naming can be like:

  • Parameter
  • ParameterGroup
  • ActivatableParameterGroup (this one bit too long, but I see no alternatives to Activatable term

Or we can shorten Parameter to Param, but user can do that as well, so not a lot of sense in here.

Then we have Host Groups to think about.

IMO we can go with HG suffix for HostGroup, because full HostGroup will be confusing when used with ParameterGroup

Then we'll have:

  • ParameterHG
  • ParameterGroupHG
  • ActivatableParameterGroupHG

or as a prefix:

  • HGParameter
  • HGParameterGroup
  • HGActivatableParameterGroup

In these cases HG works like "modifier" that it's the same entity, but for HostGroups


Desyncable term speaks about property of an entity, not it's context.

return self


class Group(_Group):
Copy link
Member

@kuhella kuhella Nov 28, 2024

Choose a reason for hiding this comment

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

as we have Group in RBAC it may lead to misunderstanding. may be use GroupParameter or GroupOfParameter?

Copy link
Collaborator Author

@Sealwing Sealwing Nov 28, 2024

Choose a reason for hiding this comment

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

As you wish, but for me it seems easier:

  1. Let the user decide (when he wants Group from config and rbac both in the same code, he can rename one of them)
  2. Name RBACGroup or UserGroup, etc.

IMO name that's used in typing shouldn't be too long

GroupOfConfigParameter => DesyncableGroupOfConfigParameter or GroupOfConfigParameterOfHostGroup (very long)


same as about parameter, I'll think about consistent and convenient naming


# inner type won't be checked (list),
# but here we pretend "to be 100% sure" it's `list`, not `None`
config["root_list", Value].set([*config["root_list", Value[list]].value, new_config["root_list"][-1]])
Copy link
Member

Choose a reason for hiding this comment

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

why set accept two parameter? seems it invoked as instance method of existing instance why do we need to pass self?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

set accept 1 parameter

@Sealwing Sealwing merged commit 936b659 into feature/ADCM-6064 Nov 29, 2024
4 checks passed
@Sealwing Sealwing deleted the ADCM-6125-2 branch November 29, 2024 09:02
a-alferov pushed a commit that referenced this pull request Dec 9, 2024
Starovoitov pushed a commit that referenced this pull request Dec 13, 2024
Starovoitov pushed a commit that referenced this pull request Dec 16, 2024
Starovoitov pushed a commit that referenced this pull request Dec 16, 2024
a-alferov pushed a commit that referenced this pull request Jan 24, 2025
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