Skip to content

Msp allow docs name#648

Open
MaximilianSoerenPollak wants to merge 7 commits into
eclipse-score:mainfrom
MaximilianSoerenPollak:MSP_allow_docs_name
Open

Msp allow docs name#648
MaximilianSoerenPollak wants to merge 7 commits into
eclipse-score:mainfrom
MaximilianSoerenPollak:MSP_allow_docs_name

Conversation

@MaximilianSoerenPollak

Copy link
Copy Markdown
Contributor

📌 Description

Allow the docs macro to be used with a name attribute as is custom for almost all bazel macros.
This will allow us in the future to use the docs marco in the same build file multiple times, with different inputs and have no collision.
This should be a good first step towards coming closer to how bazel macros should be written and make it more useable in other settings too.

=> Still a challenge though is how we can enforce non idiotic usage of this in S-CORE.

ℹ️ Still a Draft PR until the Docs are changed and we have agreed internally how this should be done.

🚨 Impact Analysis

  • This change does not violate any tool requirements and is covered by existing tool requirements
  • This change does not violate any design decisions
  • Otherwise I have created a ticket for new tool qualification

✅ Checklist

  • Added/updated documentation for new or changed features
  • Added/updated tests to cover the changes
  • Followed project coding standards and guidelines

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run --lockfile_mode=error //src:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
Extracting Bazel installation...
Starting local Bazel server (8.6.0) and connecting to it...
INFO: Invocation ID: 4c0f592c-3e14-43d2-a483-2e8a2b54bcdc
Computing main repo mapping: 
Computing main repo mapping: 
Loading: 
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
    currently loading: src
WARNING: Target pattern parsing failed.
ERROR: Skipping '//src:license-check': no such target '//src:license-check': target 'license-check' not declared in package 'src' defined by /home/runner/work/docs-as-code/docs-as-code/src/BUILD
ERROR: no such target '//src:license-check': target 'license-check' not declared in package 'src' defined by /home/runner/work/docs-as-code/docs-as-code/src/BUILD
INFO: Elapsed time: 6.477s
INFO: 0 processes.
ERROR: Build did NOT complete successfully
ERROR: Build failed. Not running target

repo = repo.lstrip("@")

if path_to_target == "" and target in ("needs_json", "docs_sources"):
# The producer's docs() macro may have used a custom `name`, in which case its targets

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Probably can make this nicer with saying "docs_sources" in target

@github-actions

Copy link
Copy Markdown

The created documentation from the pull request is available at: docu-html

Comment thread src/helper_lib/__init__.py Outdated
Comment on lines +38 to +51
def add_config_value_if_absent(
app: Sphinx, name: str, default: Any, rebuild: _ConfigRebuild
) -> None:
"""Register a Sphinx config value, unless another extension already has.

Several of our extensions may be used either standalone or bundled together via
score_sphinx_bundle, in either load order, and may each want the same config value
registered. Sphinx raises if `add_config_value` is called twice for the same name,
so this guards the registration to make it safe to call from multiple extensions.
"""
# Sphinx has no public API for this check either; `_options` is the internal dict
# `Config.add` itself consults to reject duplicate registrations.
if name not in app.config._options: # pyright: ignore [reportPrivateUsage]
app.add_config_value(name, default, rebuild=rebuild)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

is this truly needed?

Not using score_bundle should be not allowed in S-CORE, so I thin kwe can remove this,

@MaximilianSoerenPollak MaximilianSoerenPollak left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Probably 1 - 2 things still to iron out here, but overall looks like a good approach I think

Comment thread docs.bzl

By using this function, you'll get any and all updates for documentation targets in one place.

The macro can be called multiple times in the same BUILD file as long as each call uses a

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not convinced that this is a good idea.

There can only be exactly one documentation hosted by github.io. What is the motivation to have more?

The need to distribute documentation across the repo is addressed by implemented DR-008-infra.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes there can be only one hosted, that is correct.

This is to allow for multiple docs to be build, without it being hosted.
Basically many independent documentations in one repo and allow / enable them all to be build without them needing to be hosted.
This is also in anticipation of the split up we might need to do in regards to trlc things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants