8000 Add NumberPool Documentation by FragmentedPacket · Pull Request #6577 · opsmill/infrahub · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add NumberPool Documentation #6577

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

Open
wants to merge 8 commits into
base: release-1.3
Choose a base branch
from

Conversation

FragmentedPacket
Copy link
Contributor
  • New topic page
  • Updated model schemas and initial data loading of demo data
  • Automated screenshots

@FragmentedPacket FragmentedPacket requested review from a team as code owners May 30, 2025 16:25
Copy link
codspeed-hq bot commented May 30, 2025

CodSpeed Performance Report

Merging #6577 will not alter performance

Comparing FragmentedPacket:may-202505-numberpool-docs (482fda9) with release-1.3 (a290a35)

Summary

✅ 10 untouched benchmarks

@@ -16,6 +16,12 @@ generics:
label: Name
optional: false
order_weight: 1
- name: service_identifier
kind: NumberPool
read_only: true
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not related to this PR but I think we shouldn't require the user to define read_only: true for NumberPool and Computed Attribute, it shoul 10000 d be automatic and we should raise an error if user is trying to enforce read_only: false
cc @ogenstad @wvandeun

Copy link
Contributor

Choose a reason for hiding this comment

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

For now as the read_only attribute defaults to False in the models I'm not sure we can do that. If we look at models for the schema generation we could change it so that it would default to None and get changed to False if no choice has been made.

Copy link
Contributor

Choose a reason for hiding this comment

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

I do agree that it would be nice to have this type of attribute (and computed attribtute) to be read-only by default.
If it is not possible to do it today, or if it is to involved the we should open an issue/feature request in the future.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be part of INFP-234 where we somewhere add a note that we want this.

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you know if you can put a label or HFID on that one? would look nicer I guess

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ogenstad Do you have info on this? I believe the number pool is generated behind the scenes, but not sure how the name can be constructed by a user?

Copy link
Contributor

Choose a reason for hiding this comment

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

What we're seeing here is the actual name of the pool. There is a uniqueness constraint on the name and the idea is to ensure that the name doesn't conflict with anything else. Instead of just using the uuid of the pool I added the kind and attribute name as help.

Currently it would be possible for a user to rename the pool to something else after it has been created. Potentially we could provide a name within the schema but that could also introduce complexity if the name already exists etc.

Any preference around this?

Copy link
Contributor

Choose a reason for hiding this comment

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

If we give the user the option to specify the name, then we could get into the issue again where someone renames the pool name in Infrahub and then it is out of sync with what we defined in the schema file. So I would not implement that.

The whole point of the feature is that we abstract the fact that there is a pool attached to the attribute. So I think it should be ok with the current name.


<Tabs>
<TabItem value="Number">
| Parameter | Default | Required |
Copy link
Contributor

Choose a reason for hiding this comment

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

Should the required column really be here? Will have a parameter that will ever be required? To me it feels like they will always be optional.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will remove the column from the template for this.

@@ -155,6 +158,12 @@ The `kind` of a model is generated by concatenating the `namespace` and the `nam

</details>

#### Attribute Parameters

There are some attribute kinds that allow `parameters` to be passed to control the behavior of the attribute. Below are the attribute kinds and their accepted parameters.
Copy link
Contributor

Choose a reason for hiding this comment

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

that allow optional parameters

@FragmentedPacket FragmentedPacket changed the base branch from develop to release-1.3 June 3, 2025 15:26
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.

5 participants
0