Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/instructions/process_req.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ applyTo: "docs/requirements/requirements.rst"
---

This file contains docs-as-code requirements which derived from upstream process requirements.
Those are specified in `bazel-out/k8-fastbuild/bin/external/score_process+/needs_json/_build/needs/needs.json`
Those are specified in `bazel-out/k8-fastbuild/bin/external/score_process_description+/needs_json/_build/needs/needs.json`

The docs-as-code requirements are implemented in this repository, most notably in `src/extensions/score_metamodel/metamodel.yaml`
The metamodel has references to docs-as-code requirement ids.
Expand Down
2 changes: 1 addition & 1 deletion BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ docs(
project = "S-CORE Docs-as-Code",
project_url = "https://eclipse-score.github.io/docs-as-code",
external_needs = [
"@score_process//:needs_json_file",
"@score_process_description//:needs_json_file",
],
bundles = [
{
Expand Down
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ http_file(
urls = ["https://github.com/withered-magic/starpls/releases/download/v0.1.21/starpls-linux-amd64"],
)

bazel_dep(name = "score_process", version = "2.0.3")
bazel_dep(name = "score_process_description", version = "2.1.0")

# Provide the tools from the devcontainer to Bazel
bazel_dep(name = "score_devcontainer", version = "1.11.0")
4 changes: 2 additions & 2 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def docs(
"attach_to": <optional, file where the bundle shall be attached, defaults to the parent section's index>,
}.
Note: a bundle label may also point at another module's auto-exposed
bundle, e.g. "@score_process//:docs_bundle".
bundle, e.g. "@score_process_description//:docs_bundle".
"""
# HINT: keep documentation sync docs/reference/bazel_macros.rst

Expand Down
2 changes: 1 addition & 1 deletion docs/how-to/mounts/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ Every project using ``docs()`` exposes its own source directory as
docs(
bundles = [
{
"bundle": "@score_process//:docs_bundle",
"bundle": "@score_process_description//:docs_bundle",
"mount_at": "process",
"attach_to": "index",
},
Expand Down
6 changes: 3 additions & 3 deletions docs/how-to/other_modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ A minimal example (add or extend the existing `bazel_deps` stanza):

.. code-block:: starlark

bazel_dep(name = "score_process", version = "1.5.3")
bazel_dep(name = "score_process_description", version = "2.1.0")

2a) Import the other module's built inventory
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -53,7 +53,7 @@ Example `BUILD` snippet (consumer module):
load("@score_docs_as_code//:docs.bzl", "docs")
docs(
external_needs = [
"@score_process//:needs_json",
"@score_process_description//:needs_json",
],
source_dir = "docs",
)
Expand All @@ -76,7 +76,7 @@ Example `BUILD` snippet (consumer module):
docs(
bundles = [
{
"bundle": "@score_process//:docs_bundle",
"bundle": "@score_process_description//:docs_bundle",
"mount_at": "process",
"attach_to": "index",
},
Expand Down
2 changes: 1 addition & 1 deletion docs/how-to/source_to_doc_links.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ uses. You may also pass filegroups; their files are scanned directly.

docs(
data = [
"@score_process//:needs_json",
"@score_process_description//:needs_json",
],
source_dir = "docs",
code_targets = [":some_application"],
Expand Down
3 changes: 1 addition & 2 deletions docs/internals/requirements/requirements.rst
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ but for ease of traceability this is a separate one.
:id: tool_req__arch_linkage_safety
:implemented: YES
:version: 2
:satisfies: gd_req__arch_linkage_safety[version==1], gd_req__arch_build_blocks_corr[version==2]
:satisfies: gd_req__arch_linkage_safety[version==1], gd_req__arch_build_blocks_corr[version==3]
:parent_covered: YES

.. csv-table::
Expand All @@ -717,7 +717,6 @@ but for ease of traceability this is a separate one.
comp, consists_of, comp, no
real_arc_int_op, included_by, real_arc_int, yes
real_arc_int_op, implements, logic_arc_int_op, no
logic_arc_int, includes, logic_arc_int_op, no
logic_arc_int_op, included_by, logic_arc_int, yes

.. note::
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/bazel_macros.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Minimal example (root ``BUILD``)
],
bundles = [
# dicts describing bundles to mount into this project
# e.g. {"bundle": "@score_process//:docs_bundle", "mount_at": "process"}
# e.g. {"bundle": "@score_process_description//:docs_bundle", "mount_at": "process"}
],
deps = [
# additional bazel labels providing Python deps or other runfiles
Expand Down
1 change: 0 additions & 1 deletion src/extensions/score_metamodel/metamodel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,6 @@ needs_types:
# req-Id: tool_req__arch_linkage_safety
# New direction kept optional during migration; will supersede feat includes logic_arc_int
included_by: feat
includes: logic_arc_int_op
fulfils: feat_req
tags:
- architecture_element
Expand Down
10 changes: 5 additions & 5 deletions src/extensions/score_mounts/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ def _canonical_mount_dir(walk_dir: Path, spec: MountSpec) -> Path:

- for external repositories, the repository directory exists in the action
sandbox, for example
``.../sandbox/.../execroot/_main/external/score_process+/process``;
``.../sandbox/.../execroot/_main/external/score_process_description+/process``;
files inside that directory can be symlinks to Bazel's repository
cache, for example
``~/.cache/bazel/.../external/score_process+/process/index.rst``.
``~/.cache/bazel/.../external/score_process_description+/process/index.rst``.
- for generated data bundles, the mount root may be the sandbox copy of a
``bazel-out`` directory, for example
``.../sandbox/.../execroot/_main/bazel-out/.../docs/generated``;
Expand All @@ -133,11 +133,11 @@ def _canonical_mount_dir(walk_dir: Path, spec: MountSpec) -> Path:
source file first and then walk back by its bundle-relative suffix. Example:

``walk_dir``:
``.../sandbox/.../external/score_process+/process``
``.../sandbox/.../external/score_process_description+/process``
``source_file``:
``.../sandbox/.../external/score_process+/process/index.rst``
``.../sandbox/.../external/score_process_description+/process/index.rst``
``source_file.resolve()``:
``~/.cache/bazel/.../external/score_process+/process/index.rst``
``~/.cache/bazel/.../external/score_process_description+/process/index.rst``

Since ``index.rst`` is one path component below ``walk_dir``, its parent is
the canonical mount root. For ``subdir/page.rst`` we walk back two
Expand Down
22 changes: 11 additions & 11 deletions src/extensions/score_mounts/tests/test_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,20 +91,20 @@ def test_external_mount_keeps_execroot_and_runfiles_locations(tmp_path: Path) ->
"mount_at": "x",
},
{
"src_root": "external/score_process+/docs_as_mount",
"runtime_path": "../score_process+/docs_as_mount",
"src_root": "external/score_process_description+/docs_as_mount",
"runtime_path": "../score_process_description+/docs_as_mount",
"mount_at": "process",
"external": True,
"repository": "score_process+",
"repository": "score_process_description+",
},
],
},
)
specs = load_mounts_manifest(str(manifest)).mounts
assert specs[0].src_root == "src/docs"
assert specs[1].src_root == "external/score_process+/docs_as_mount"
assert specs[1].src_root == "external/score_process_description+/docs_as_mount"
assert specs[1].external is True
assert specs[1].repository == "score_process+"
assert specs[1].repository == "score_process_description+"


def test_load_missing_required_key_raises(tmp_path: Path) -> None:
Expand All @@ -129,8 +129,8 @@ def test_external_mount_uses_execroot_path_in_sandbox(
{
"mounts": [
{
"src_root": "external/score_process+/docs_as_mount",
"runtime_path": "../score_process+/docs_as_mount",
"src_root": "external/score_process_description+/docs_as_mount",
"runtime_path": "../score_process_description+/docs_as_mount",
"mount_at": "process",
"external": True,
}
Expand All @@ -139,7 +139,7 @@ def test_external_mount_uses_execroot_path_in_sandbox(
)
spec = load_mounts_manifest(manifest).mounts[0]
assert resolve_walk_dir(load_mounts_manifest(manifest), spec, None) == (
tmp_path / "external" / "score_process+" / "docs_as_mount"
tmp_path / "external" / "score_process_description+" / "docs_as_mount"
)


Expand All @@ -149,8 +149,8 @@ def test_external_mount_uses_runfiles_root_under_bazel_run(tmp_path: Path) -> No
{
"mounts": [
{
"src_root": "external/score_process+/docs_as_mount",
"runtime_path": "../score_process+/docs_as_mount",
"src_root": "external/score_process_description+/docs_as_mount",
"runtime_path": "../score_process_description+/docs_as_mount",
"mount_at": "process",
"external": True,
}
Expand All @@ -163,4 +163,4 @@ def test_external_mount_uses_runfiles_root_under_bazel_run(tmp_path: Path) -> No
spec,
tmp_path / "workspace",
tmp_path,
) == (tmp_path / "score_process+" / "docs_as_mount")
) == (tmp_path / "score_process_description+" / "docs_as_mount")
4 changes: 2 additions & 2 deletions src/extensions/score_sync_toml/test_mounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def test_materialize_mounts_maps_external_runfiles_path_to_bazel_bin(
tmp_path: Path, monkeypatch: pytest.MonkeyPatch
) -> None:
runfiles_dir = tmp_path / "runfiles"
walk_dir = runfiles_dir / "score_process+" / "process"
walk_dir = runfiles_dir / "score_process_description+" / "process"
walk_dir.mkdir(parents=True)
monkeypatch.setattr(_mounts, "find_git_root", lambda: None)
monkeypatch.setattr(_mounts, "get_runfiles_dir", lambda: runfiles_dir)
Expand All @@ -68,7 +68,7 @@ def test_materialize_mounts_maps_external_runfiles_path_to_bazel_bin(

assert fragment is not None
assert fragment.read_text(encoding="utf-8") == (
'[[mounts]]\ndir = "bazel-bin/external/score_process+/process"\nmount_at = "process"\n'
'[[mounts]]\ndir = "bazel-bin/external/score_process_description+/process"\nmount_at = "process"\n'
)


Expand Down
2 changes: 1 addition & 1 deletion src/tests/docs_bzl/scenarios/external_bundle/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ docs(
source_dir = "host_docs",
test_sources = ["src/tests/docs_bzl/scenarios/external_bundle"],
bundles = [{
"bundle": "@score_process//:docs_bundle",
"bundle": "@score_process_description//:docs_bundle",
"mount_at": "process",
}],
)
Loading