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

Sur 02112024 docs #4834

Open
wants to merge 5 commits into
base: stable
Choose a base branch
from
Open

Sur 02112024 docs #4834

wants to merge 5 commits into from

Conversation

vsurresh
Copy link
Contributor

@vsurresh vsurresh commented Nov 3, 2024

  • Moved 'import schema' page to 'schema' topics
  • updated infrahubctl page
  • Added 'Schema' page to the sidebar

@github-actions github-actions bot added the type/documentation Improvements or additions to documentation label Nov 3, 2024
@vsurresh
Copy link
Contributor Author

vsurresh commented Nov 3, 2024

Cloudflare pages - https://sur-02112024-docs.infrahub.pages.dev/

@vsurresh vsurresh self-assigned this Nov 3, 2024
@vsurresh vsurresh requested a review from a team November 3, 2024 19:56
```yaml
---
version: '1.0'
nodes:
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe add the generics section as well


The recommended way to manage and load a schema is to create a schema file in YAML format. With a schema file it's possible to:

- Define new nodes
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- Define new nodes
- Define new nodes
- Define new generics


:::

## Load a schema file
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe here we could guide people in the choice, when to use git integration vs infrahubctl, pros and cons.

For instance I added that paragraph in the schema library:

There are several ways to [load a schema in Infrahub](https://docs.infrahub.app/guides/import-schema):

Quick View: To take a quick look at a schema, you can use Infrahub CTL. Follow [this guide](https://docs.infrahub.app/infrahubctl) to install Infrahub CTL.
Controlled Integration: For a more organized and unified approach to loading schemas, you can connect a Git repository. Follow [this guide](https://docs.infrahub.app/guides/repository) to connect a Git repository.

---
schemas:
- schemas/demo_edge_fabric.yml
```
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we can remove the following note below, it's redondant and not really related to the section load schema

@@ -32,10 +32,12 @@ The `infrahubctl` command line utility is installed as a part of the [Infrahub S
| `INFRAHUB_API_TOKEN` | `06438eb2-8019-4776-878c-0941b1f1d1ec` |
| `INFRAHUB_DEFAULT_BRANCH` | main |

> You can also provide the location of a configuration file via the environment variable `INFRAHUBCTL_CONFIG`.
You can obtain the `INFRAHUB_API_TOKEN` from the web GUI by navigating to 'Account Settings' under your profile and selecting 'Tokens'. You can also manage the tokens via GraphQL queries. You can find more information on how to do that [here](/guides/managing-api-tokens).
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd just say "don't have a token yet? you can find more information on how to manage API token in this guide". So if one day we change that part of the product we can change only the directly related documentation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, I will change it.

Copy link
Contributor

Choose a reason for hiding this comment

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

I have a feeling this file becomes a hodgepodge of things:

  • It's a guide that explains how to load a schema
  • It's a topic that explains what the schema is
  • It's a reference that explains what the format of a schema file is

Here we line out how docs should be organized. I think we should split up the multiple aspects of this file into their proper sections, taken into account that some parts might already exist (like the schema reference and creating a schema guide)
https://docs.infrahub.app/development/docs#organizing-new-pages

There are several ways to [load a new schema](/guides/import-schema).
## Schema file

The recommended way to manage and load a schema is to create a schema file in YAML format. With a schema file it's possible to:
Copy link
Contributor

Choose a reason for hiding this comment

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

It's not necessarily the recommended way. It's just a way of doing it together with the repository method.

Arguably, in a production environment, you might want to have the schema in an external repository and let Infrahub import the changes from it.

infrahubctl schema load is great when you are developing a schema or trying to test something, or when you want to make one of changes, which might be required during some migrations.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@wvandeun @BaptisteGi - Currently, under the Guides section, we have a 'Creating a Schema' page that covers a lot, including how to import the schema file. Then we have the next page, 'Schema File', which also covers how to import a schema file. That's why I thought it would be good to move the contents of that page under the 'Schema' topics. I didn't change anything except for adding 'How to generate the token'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants