Skip to content

Respect user configuration#428

Open
a-zw wants to merge 4 commits intoeclipse-score:mainfrom
etas-contrib:respect-others
Open

Respect user configuration#428
a-zw wants to merge 4 commits intoeclipse-score:mainfrom
etas-contrib:respect-others

Conversation

@a-zw
Copy link
Contributor

@a-zw a-zw commented Feb 27, 2026

📌 Description

Don't blindly overwrite user configuration.
Instead set configuration only when not set before.

🚨 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
Copy link

github-actions bot commented Feb 27, 2026

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: 2693ff6b-c901-4f6e-b412-f1f7cc49e33b
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Loading: 
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
    currently loading: src
Loading: 0 packages loaded
    currently loading: src
Analyzing: target //src:license-check (1 packages loaded)
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 (66 packages loaded, 9 targets configured)

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

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

Analyzing: target //src:license-check (128 packages loaded, 1766 targets configured)

Analyzing: target //src:license-check (129 packages loaded, 2510 targets configured)

Analyzing: target //src:license-check (140 packages loaded, 2576 targets configured)

Analyzing: target //src:license-check (140 packages loaded, 2576 targets configured)

Analyzing: target //src:license-check (140 packages loaded, 2576 targets configured)

INFO: Analyzed target //src:license-check (145 packages loaded, 4715 targets configured).
[5 / 15] [Prepa] Writing repo mapping manifest for //src:license.check.license_check
[14 / 16] [Prepa] JavaToolchainCompileBootClasspath external/rules_java+/toolchains/platformclasspath.jar
[15 / 16] Building src/license.check.license_check.jar (); 0s disk-cache, multiplex-worker
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: 24.712s, Critical Path: 2.62s
INFO: 16 processes: 12 internal, 3 processwrapper-sandbox, 1 worker.
INFO: Build completed successfully, 16 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>]

@a-zw a-zw force-pushed the respect-others branch from a7814d2 to 86b3bcf Compare March 2, 2026 08:24
@a-zw a-zw force-pushed the respect-others branch from 86b3bcf to d92cfb0 Compare March 2, 2026 08:25
Copy link
Contributor

@MaximilianSoerenPollak MaximilianSoerenPollak left a comment

Choose a reason for hiding this comment

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

Some questions that came to mind.
But overall looks like a good approach. 💯

**sphinx_options.needs_global_options,
**app.config.needs_global_options,
}
config_setdefault(app.config, "html_theme", html_options.html_theme)
Copy link
Contributor

Choose a reason for hiding this comment

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

A bit confused why this is only used here?

Will the unpacking via ** what will happen if keys are already there? Would it not error?


puml = score_layout_path / "assets" / "puml-theme-score.puml"
app.config.needs_flow_configs = {"score_config": f"!include {puml}"}
app.config.needs_flow_configs.setdefault("score_config", f"!include {puml}")
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this just .setdefault ? Instead of config_setdefault?

Comment on lines +54 to +55
app.config.source_suffix.setdefault(".rst", "restructuredtext")
app.config.source_suffix.setdefault(".md", "markdown")
Copy link
Contributor

Choose a reason for hiding this comment

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

Also 'setdefault' instead of config_setdefault?

Comment on lines +57 to +58
if "templates" not in app.config.templates_path:
app.config.templates_path += ["templates"]
Copy link
Contributor

Choose a reason for hiding this comment

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

This would then add templates to it even if there are none there or they are somewher else for the user no?
Would it not be better to have it be only set if it's empty?

Comment on lines +36 to +46
def test_config_setdefault_sets_when_not_in_raw_config():
cfg = _FakeConfig(raw={})
config_setdefault(cfg, "html_copy_source", False) # pyright: ignore [reportArgumentType]
assert cfg.html_copy_source is False # pyright: ignore [reportAttributeAccessIssue]


def test_config_setdefault_does_not_overwrite_user_value():
cfg = _FakeConfig(raw={"html_copy_source": True})
cfg.html_copy_source = True # pyright: ignore[reportAttributeAccessIssue]
config_setdefault(cfg, "html_copy_source", False) # pyright: ignore [reportArgumentType]
assert cfg.html_copy_source is True # pyright: ignore[reportAttributeAccessIssue]
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we really ignore all of the warnings here?
I guess for tests it isn't as severe as for normal code.

@MaximilianSoerenPollak
Copy link
Contributor

Also error in the build documentation:

/home/runner/work/docs-as-code/docs-as-code/docs/concepts/bidirectional_traceability.rst:102: WARNING: plantuml command 'plantuml' cannot be run [plantuml]
/home/runner/work/docs-as-code/docs-as-code/docs/concepts/docs_deps.rst:41: WARNING: plantuml command 'plantuml' cannot be run [plantuml]

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

Labels

None yet

Projects

Status: Draft

Development

Successfully merging this pull request may close these issues.

2 participants