Skip to content

docs: add settings documentation to otel.py and generate documentation. Fixes #751#817

Open
martynia wants to merge 4 commits intoDIRACGrid:mainfrom
martynia:janusz_fix_document_settings
Open

docs: add settings documentation to otel.py and generate documentation. Fixes #751#817
martynia wants to merge 4 commits intoDIRACGrid:mainfrom
martynia:janusz_fix_document_settings

Conversation

@martynia
Copy link
Contributor

@martynia martynia commented Mar 3, 2026

This PR adds missing documentation to otel.py, and add its path to .pre-commit-config.yaml. Documentation for databases is not yet covered since the db system doesn't follow the service settings scheme. Added osx-64 platform to pixi as well.

@martynia martynia force-pushed the janusz_fix_document_settings branch from beafa8b to 0fb3e6c Compare March 3, 2026 14:31
@read-the-docs-community
Copy link

read-the-docs-community bot commented Mar 3, 2026

Documentation build overview

📚 diracx | 🛠️ Build #31882363 | 📁 Comparing 4f78de5 against latest (a59841d)


🔍 Preview build

Show files changed (1 files in total): 📝 1 modified | ➕ 0 added | ➖ 0 deleted
File Status
admin/reference/env-variables/index.html 📝 modified

@aldbr aldbr linked an issue Mar 3, 2026 that may be closed by this pull request
1 task
@aldbr aldbr requested a review from fstagni March 4, 2026 08:20
@fstagni
Copy link
Contributor

fstagni commented Mar 4, 2026

This PR recovers the previous documentation for OTEL env variables, but there's a bit more left to be added, that was there previously:

  • DIRACX_LEGACY_EXCHANGE_HASHED_API_KEY
  • DIRACX_SERVICE_JOBS_ENABLED
  • as mentioned, the DB ones

I think those should be recovered in order to consider the original task closed (I understand this makes the task more complex, this was clearly not foreseen).

@aldbr
Copy link
Contributor

aldbr commented Mar 5, 2026

ddev:
DB should follow the same pattern as OTEL ones, it's expected to be straightforward.
for the other points, comments are expected to follow.

@chaen
Copy link
Contributor

chaen commented Mar 5, 2026

There's also DIRACX_SERVICE_DOTENV

@chaen
Copy link
Contributor

chaen commented Mar 5, 2026

DIRACX_SERVICE_JOBS_ENABLED, as well as the dbs one are dynamically constructed, so they are easy to dynamically generate for the doc too

https://github.com/DIRACGrid/diracx/blob/main/diracx-routers/src/diracx/routers/factory.py#L355

var_name = f"DIRACX_DB_URL_{entry_point.name.upper()}"

And the OS db as well

var_name = f"DIRACX_OS_DB_{entry_point.name.upper()}"

@chrisburr chrisburr marked this pull request as draft March 9, 2026 05:20
@martynia
Copy link
Contributor Author

@chaen generate_setings_doc is a in-house development designed to generate documentation for static-defined variables in classes that inherit from ServiceSettingsBase, which are automatically discovered. How would it cover dynamically defined environment variables?
@ryuwd, since you designed the original system, do you have any hint how to extend it to cover dynamically defined variables?

@aldbr
Copy link
Contributor

aldbr commented Mar 18, 2026

@martynia from what I understand after discussing with @chaen, the documentation of these variables can't be auto-generated because they are not relying on the ServiceSettingsBase. Therefore, the documentation simply needs to be hardcoded within the template here: https://github.com/DIRACGrid/diracx/blob/3e495e11893cd14e0a3612ca175e46f16e6ae2d1/docs/admin/reference/env-variables.md.j2

@martynia
Copy link
Contributor Author

Do expect me to create a setting class and let the template to render it or to put the text directly into the template ?

@aldbr
Copy link
Contributor

aldbr commented Mar 18, 2026

Do expect me to create a setting class and let the template to render it or to put the text directly into the template ?

Put the text directly into the template

@martynia martynia force-pushed the janusz_fix_document_settings branch from 0fb3e6c to eee17a6 Compare March 18, 2026 18:45
@fstagni
Copy link
Contributor

fstagni commented Mar 19, 2026

Still a draft? @martynia do you need to still add something to this one?

@aldbr aldbr force-pushed the janusz_fix_document_settings branch from eee17a6 to ef9a6e5 Compare March 19, 2026 10:18
@martynia martynia marked this pull request as ready for review March 19, 2026 10:40
@martynia
Copy link
Contributor Author

No, it should be ready.

Comment on lines +9 to +18
### `DIRACX_LEGACY_EXCHANGE_HASHED_API_KEY`
The hashed API key for the legacy exchange endpoint.

### `DIRACX_SERVICE_DOTENV`
The variable points to .env files where configuration may be placed. There could be more than one file, with suffixes
_X, where X is a number. The files will be loaded in order.

### `DIRACX_SERVICE_JOBS_ENABLED`
Determines whether the jobs service is enabled.

Copy link
Contributor

Choose a reason for hiding this comment

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

Why here and not between ##Databases and SandboxStoreSettings?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently Database is after SandboxStore, if I put them between, they would belong to SandboxStore. Should those setting have their own section or sections? The dotinv one looks like a major one, shouldn't it go on top ? The same is true with DIRACX_CONFIG_BACKEND_URL. Which section should this go to ?

Copy link
Contributor

Choose a reason for hiding this comment

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

The Core section is good. Can you also remove the duplicated DIRACX_SERVICE_DOTENV please?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok sorry, one last comment, then it's ok 😅
I think we should move DIRACX_SERVICE_JOBS_ENABLED in the Core section and DIRACX_LEGACY_EXCHANGE_HASHED_API_KEY should likely go before SandboxStoreSettings as you did originally (sorry 😅 )

@DIRACGridBot DIRACGridBot marked this pull request as draft March 19, 2026 12:38
@martynia martynia force-pushed the janusz_fix_document_settings branch from ef9a6e5 to 8487fdb Compare March 19, 2026 14:16
@martynia martynia force-pushed the janusz_fix_document_settings branch from f87290b to 6ad468d Compare March 19, 2026 14:52
@martynia martynia marked this pull request as ready for review March 19, 2026 14:53
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.

[Bug]: Recover doc lost when merging auto-generation

4 participants