Skip to content

Commit

Permalink
docs: Optional is False by default rather than True. (#5288)
Browse files Browse the repository at this point in the history
* Optional is  by default rather than .

* Update source of attribute optional doc so it will be auto-generated.

* Testing to see if pipeline works with new changes to check for auto generated docs changes.

* Add back the upstream Python change for optional attribute default to be False.
  • Loading branch information
FragmentedPacket authored and gmazoyer committed Jan 9, 2025
1 parent 160ad23 commit 9b62ff7
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
14 changes: 14 additions & 0 deletions .github/file-filters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,16 @@ yaml_all: &yaml_all
markdown_all: &markdown_all
- "**/*.{md,mdx}"

infrahub_reference_generated: &infrahub_reference_generated
- "docs/docs/reference/infrahub-cli/*.mdx"
- "docs/docs/reference/schema/*.mdx"
- "docs/docs/reference/dotinfrahub.mdx"
- "docs/docs/python-sdk/reference/config.mdx"
- "docs/docs/reference/message-bus-events.mdx"

infrahub_ctl_generated: &infrahub_ctl_generated
- "docs/docs/infrahubctl/*.mdx"

backend_all:
- *backend_files
- *ci_config
Expand All @@ -66,6 +76,10 @@ documentation_all:
- *doc_files
- *markdown_all

documentation_generated_all:
- *infrahub_reference_generated
- *infrahub_ctl_generated

release_all:
- *release_files

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
outputs:
backend: ${{ steps.changes.outputs.backend_all }}
documentation: ${{ steps.changes.outputs.documentation_all }}
documentation_generated: ${{ steps.changes.outputs.documentation_generated_all }}
release: ${{ steps.changes.outputs.release_all }}
frontend: ${{ steps.changes.outputs.frontend_all }}
helm: ${{ steps.changes.outputs.helm_all }}
Expand Down Expand Up @@ -540,7 +541,7 @@ jobs:
always() && !cancelled() &&
!contains(needs.*.result, 'failure') &&
!contains(needs.*.result, 'cancelled') &&
needs.files-changed.outputs.python == 'true'
(needs.files-changed.outputs.python == 'true') || (needs.files-changed.outputs.documentation_generated == 'true')
needs: ["files-changed", "yaml-lint", "python-lint"]
runs-on: "ubuntu-22.04"
timeout-minutes: 5
Expand Down
2 changes: 1 addition & 1 deletion backend/infrahub/core/schema/definitions/internal.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ def to_dict(self) -> dict[str, Any]:
name="optional",
kind="Boolean",
description="Indicate if this attribute is mandatory or optional.",
default_value=True,
default_value=False,
override_default_value=False,
optional=True,
extra={"update": UpdateSupport.VALIDATE_CONSTRAINT},
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/reference/schema/attribute.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ extensions:
| **Kind** | `Boolean` |
| **Description** | Indicate if this attribute is mandatory or optional. |
| **Optional** | True |
| **Default Value** | True |
| **Default Value** | False |
| **Constraints** | |

### order_weight
Expand Down

0 comments on commit 9b62ff7

Please sign in to comment.