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

[#2297] Add documentation for automating configurations #1150

Merged
merged 9 commits into from
May 16, 2024

Conversation

pi-sigma
Copy link
Contributor

@pi-sigma pi-sigma commented Apr 9, 2024

Documentation for configuration setup via environment variables:

  • General configuration
  • Klanten
  • ZGW
  • Authentication (DigiD, eHerkenning, Azure)
  • CMS
  • Document non-supported features
  • Document usage for deployment/CI
  • Automate creation of docs

Docs are generated by running python src/manage.py generate_config_docs. Pass one of the supported options ("siteconfig", "kic", "zgw", "digid_oidc", "eherkenning_oidc") to generate docs for a specific config, or run the command without arguments to generate all.

The docs are made available under `docs/configuration/".

Taiga: #2297

Related:

@pi-sigma pi-sigma force-pushed the doc/2297-config-setup branch 3 times, most recently from dc750d6 to 56a9628 Compare April 10, 2024 07:48
@codecov-commenter
Copy link

codecov-commenter commented Apr 10, 2024

Codecov Report

Attention: Patch coverage is 94.38202% with 15 lines in your changes are missing coverage. Please review.

Project coverage is 95.17%. Comparing base (475ae94) to head (8c8faa8).

Files Patch % Lines
src/open_inwoner/configurations/bootstrap/base.py 88.88% 9 Missing ⚠️
src/open_inwoner/conf/app/setup_configuration.py 88.67% 6 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1150      +/-   ##
===========================================
- Coverage    95.18%   95.17%   -0.01%     
===========================================
  Files          956      958       +2     
  Lines        34603    34750     +147     
===========================================
+ Hits         32937    33075     +138     
- Misses        1666     1675       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pi-sigma pi-sigma force-pushed the doc/2297-config-setup branch 6 times, most recently from 00051a2 to 4fca189 Compare April 12, 2024 08:16
@pi-sigma pi-sigma force-pushed the doc/2297-config-setup branch 2 times, most recently from c15fb7e to 0a3b142 Compare April 16, 2024 11:44
@pi-sigma pi-sigma force-pushed the doc/2297-config-setup branch 3 times, most recently from 3bc5139 to 9653cdd Compare April 18, 2024 08:21
@pi-sigma pi-sigma marked this pull request as ready for review April 18, 2024 09:14
@pi-sigma pi-sigma force-pushed the doc/2297-config-setup branch 4 times, most recently from a8e94fb to a14f561 Compare April 18, 2024 12:23
src/open_inwoner/configurations/bootstrap/constants.py Outdated Show resolved Hide resolved
docs/install/configurations.rst Outdated Show resolved Hide resolved
src/open_inwoner/configurations/bootstrap/constants.py Outdated Show resolved Hide resolved
@pi-sigma pi-sigma force-pushed the doc/2297-config-setup branch 2 times, most recently from d609e5d to 62d5e08 Compare April 18, 2024 14:38
@pi-sigma pi-sigma force-pushed the doc/2297-config-setup branch 2 times, most recently from 9e33830 to f78f67e Compare April 29, 2024 13:02
@pi-sigma pi-sigma marked this pull request as draft April 29, 2024 13:02
@pi-sigma pi-sigma force-pushed the doc/2297-config-setup branch 3 times, most recently from 0d62a80 to 5579bb4 Compare April 29, 2024 14:34
@pi-sigma pi-sigma force-pushed the doc/2297-config-setup branch 4 times, most recently from 87c07d0 to 8a698bf Compare April 30, 2024 13:31
Copy link
Contributor

@stevenbal stevenbal left a comment

Choose a reason for hiding this comment

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

Just the final comment regarding the descriptions for JSONFields and PrivateMediaFileFields, if that is addressed I'll approve :)

def get_model_fields(self, model) -> Iterator[Any]:
return (
field
for field in model._meta.concrete_fields
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm you're right, I see it fails on configurations.customfontset for example. Can you make a separate issue for this to check if we need to handle these relations?

Comment on lines 134 to 133
config_field.name in self.included_fields
and config_field not in self.excluded_fields
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you make a separate issue for this or add a TODO?

@pi-sigma
Copy link
Contributor Author

pi-sigma commented May 3, 2024

@stevenbal
Descriptions are added, though I had to add a description for FileField instead of PrivateMediaField because the former is returned as the type at runtime. We probably have to deal with the different kinds of PrivateMediaField separately, so I added a description for ImageField as well (even though we're not currently using it).

I simplified the filtering of config fields. Think we can double-check this when we migrate to the library.

The migration user story now has an issue for checking the handling relational fields: https://taiga.maykinmedia.nl/project/open-inwoner/task/2437

@pi-sigma pi-sigma requested a review from stevenbal May 3, 2024 09:14
@alextreme
Copy link
Member

@Bartvaderkin please re-review this PR, imho we can merge this in without the CMS envvars

Comment on lines +89 to +93
match field_type:
case item if item in BasicFieldDescription.names:
return getattr(BasicFieldDescription, field_type)
case _:
return "No information available"
Copy link
Contributor

Choose a reason for hiding this comment

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

This could be a normal if/else statement that would be readable at a glance.

@alextreme alextreme merged commit 77dce9f into develop May 16, 2024
15 checks passed
@alextreme alextreme deleted the doc/2297-config-setup branch May 16, 2024 12:56
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