Skip to content

Conversation

@WolfgangFischerEtas
Copy link
Contributor

…e in the gh_pages by approx. 10%. Add option to generate sourcecode via bazel //:docs -- --sphinx_args -t source

📌 Description

There is only 1GB of space available in gh-pages. Therefore, websites created through PR or updates on mein should be as small as possible. For optimization purposes, I have therefore disabled the source code. If necessary, it can be regenerated using an option in the bazel call.

🚨 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

…e in the gh_pages by approx. 10%. Add option to generate sourcecode via bazel //:docs -- --sphinx_args -t source
@github-actions
Copy link

github-actions bot commented Oct 20, 2025

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run //src:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
Extracting Bazel installation...
Starting local Bazel server (8.3.0) and connecting to it...
INFO: Invocation ID: 745c80ad-195d-46c7-855f-63baaf88b5b8
Computing main repo mapping: 
Computing main repo mapping: 
Loading: 
Loading: 0 packages loaded
Loading: 0 packages loaded
    currently loading: src
Analyzing: target //src:license-check (1 packages loaded, 0 targets configured)
Analyzing: target //src:license-check (1 packages loaded, 0 targets configured)

Analyzing: target //src:license-check (71 packages loaded, 9 targets configured)

Analyzing: target //src:license-check (73 packages loaded, 9 targets configured)

Analyzing: target //src:license-check (123 packages loaded, 2288 targets configured)

Analyzing: target //src:license-check (134 packages loaded, 2484 targets configured)

Analyzing: target //src:license-check (134 packages loaded, 2484 targets configured)

INFO: Analyzed target //src:license-check (137 packages loaded, 4500 targets configured).
[11 / 13] Creating runfiles tree bazel-out/k8-opt-exec-ST-d57f47055a04/bin/external/score_tooling+/dash/tool/formatters/dash_format_converter.runfiles [for tool]; 0s local
INFO: Found 1 target...
Target //src:license.check.license_check up-to-date:
  bazel-bin/src/license.check.license_check
  bazel-bin/src/license.check.license_check.jar
INFO: Elapsed time: 12.766s, Critical Path: 0.45s
INFO: 13 processes: 4 disk cache hit, 9 internal.
INFO: Build completed successfully, 13 total actions
INFO: Running command line: bazel-bin/src/license.check.license_check src/formatted.txt <args omitted>
usage: org.eclipse.dash.licenses.cli.Main [-batch <int>] [-cd <url>]
       [-confidence <int>] [-ef <url>] [-excludeSources <sources>] [-help] [-lic
       <url>] [-project <shortname>] [-repo <url>] [-review] [-summary <file>]
       [-timeout <seconds>] [-token <token>]

@github-actions
Copy link

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

def setup(app: Sphinx) -> dict[str, object]:

# Tag-recognition
if app.tags.has("source"):
Copy link
Contributor

Choose a reason for hiding this comment

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

Why use tags here? I don't think they are designed for such configuration purposes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, you're certainly right there, as tags should really be used for conditional passages in the documentation. Of course, I can also make this a generic build option again if that would be better.

Choose a reason for hiding this comment

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

I created a patch which removes the 'tag' from the setup function. Instead now a configuration value is used which is the better choice I think. Therefore you have to use bazel run //:docs -- sphinx_args -D enable_source_generation=1 if you want a website with soucecode in it.

@nicu1989
Copy link
Member

Do you have some benchmark for the 10% in size reduction? Because the source code linkage only adds some txt files. Also I would prefer if it would be the other way around: to pass a parameter to the bazel command that disables the sourcecode linking, by default being enabled.

FScholPer
FScholPer previously approved these changes Oct 21, 2025
@ubmarco
Copy link
Contributor

ubmarco commented Oct 22, 2025

I just built the documentation https://github.com/eclipse-score/score/tree/main/docs.
Output size:
image
I have not looked into the deployment, but do we delete the .doctrees before deploying? This would save 25% for this build.

@ubmarco
Copy link
Contributor

ubmarco commented Oct 22, 2025

Another option is to look into the _static folder. Maybe not all assets are required.
E.g. does the documentation use datatables?

We could also look into minifying the HTML pages.

@WolfgangFischerEtas
Copy link
Contributor Author

@ubmarco : I will have a look into this, how to remove .doctrees before copying the website to gh-pages.

@WolfgangFischerEtas
Copy link
Contributor Author

@ubmarco : I've looked into the branch gh-pages, in main or the pr-xxxx directories the .doctrees directory is not available. Therefore nothing we can optimize here.

@AlexanderLanin
Copy link
Member

pass a parameter to the bazel command that disables the sourcecode linking, by default being enabled.

It's not linking. It's embedding the source code redundantly into the html pages. The link remains available either way.

@AlexanderLanin
Copy link
Member

@ubmarco : I will have a look into this, how to remove .doctrees before copying the website to gh-pages.

Potentially a happy accident that some command ignores .* files. Maybe this one: https://github.com/eclipse-score/cicd-workflows/blob/021c830fe38f89d6867a1200708b80637ee8c1e5/.github/actions/deploy-versioned-pages/action.yml#L62

Comment on lines 44 to 45
if "score_sphinx_bundle.source_code_linker" in app.config.extensions:
app.config.extensions.remove("score_sphinx_bundle.source_code_linker")
Copy link
Member

Choose a reason for hiding this comment

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

why remove source code links here as well?


# recognition of configuration value
app.add_config_value("enable_source_generation", False, "html")
if app.config.enable_source_generation:
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't need configuration for this. Simply always disable source generation.



def setup(app: Sphinx) -> dict[str, object]:
if "score_sphinx_bundle.source_code_linker" in app.config.extensions:
Copy link
Contributor

Choose a reason for hiding this comment

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

We need the score source linker. This is not about the rst sources but about traceability to C++/Rust sources.

@AlexanderLanin AlexanderLanin merged commit c87cd89 into eclipse-score:main Dec 10, 2025
13 checks passed
@AlexanderLanin AlexanderLanin deleted the feature/sourceopt branch December 10, 2025 11:05
@github-project-automation github-project-automation bot moved this from Draft to Done in Infrastructure Dec 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

7 participants