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

Add configuration object #379

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

Conversation

christoph-hamm
Copy link
Contributor

Issues: #267

Definition of Done

The PR shall be merged only if all items mentioned in CONTRIBUTING.md have been followed. In case an item is not applicable as described, please provide a short explanation in the description.

Copy link
Contributor

@inf17101 inf17101 left a comment

Choose a reason for hiding this comment

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

First half of review is finished. Only the server part is left to review.

ank/src/filtered_complete_state.rs Outdated Show resolved Hide resolved
api/proto/ank_base.proto Outdated Show resolved Hide resolved
api/proto/ank_base.proto Outdated Show resolved Hide resolved
api/src/convert.rs Outdated Show resolved Hide resolved
api/src/convert.rs Outdated Show resolved Hide resolved
common/src/objects/config.rs Outdated Show resolved Hide resolved
common/src/objects/config.rs Outdated Show resolved Hide resolved
common/src/objects/config.rs Outdated Show resolved Hide resolved
@@ -74,6 +85,13 @@ impl TryFrom<ank_base::State> for State {
.into_iter()
.map(|(k, v)| Ok((k.to_owned(), v.try_into()?)))
.collect::<Result<HashMap<String, StoredWorkloadSpec>, String>>()?,
configs: item
Copy link
Contributor

Choose a reason for hiding this comment

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

Its Friday evening, but I am currently thinking about these lines of code: Why is the item.workloads call above (I cannot select it in the web page since it was not changed) throwing an error if it is missing? Couldn't be the workloads optional as well in the proto message?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right. I have also changed it for workloads.

common/src/objects/stored_workload_spec.rs Outdated Show resolved Hide resolved
@inf17101
Copy link
Contributor

@christoph-hamm: With the current object construction the filtering of config items via filter masks is not possible.

.collect(),
configs: HashMap::new(),
Copy link
Contributor

@inf17101 inf17101 Sep 30, 2024

Choose a reason for hiding this comment

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

Why is the workload referencing some config items but in the configs field they do not exist? My expectation to the generate_test_... functions is that I get always valid test dummy data.

Below are also other functions that contain references to configs but no configuration.

If it is conflicting in the utests, then I would suggest to create two separate functions, one that delivers me workload s and states without configs at all and the other ones delivering test data including configs.

Then we can maybe also get rid of the conditional set in the server_state.rs utest where configs is set to None in some cases.

@inf17101
Copy link
Contributor

Review part II is done. Comments published.

Comment on lines +431 to +432
("ref1".into(), "config.path.1".into()),
("ref2".into(), "config.path.2".into()),
Copy link
Contributor

@inf17101 inf17101 Sep 30, 2024

Choose a reason for hiding this comment

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

Like mentioned in the issue #267, we decided to go with just one level of referencing configs in workloads. I will implement in the upcoming changes for workload configs also a naming convention for config key names to prevent messing up the filtering (same regex like for agents and workloads)

Can you change all test data occurrences to a version without the extended path with dots. Just one level of config key reference?

christoph-hamm and others added 4 commits September 30, 2024 14:44
Co-authored-by: Oliver <42932060+inf17101@users.noreply.github.com>
Issue-Id: #267
Co-authored-by: Oliver <42932060+inf17101@users.noreply.github.com>
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.

2 participants