Skip to content

[Docs Rendering] fix several bugs - #471

Merged
LittleHuba merged 5 commits into
mainfrom
joho_rework_design_structure
Sep 17, 2026
Merged

LittleHuba merged 5 commits into
mainfrom
joho_rework_design_structure

Conversation

@hoe-jo

@hoe-jo hoe-jo commented Sep 17, 2026

Copy link
Copy Markdown
Contributor
  • architectural_design: per-view navigation
  • add --output-stem to name outputs independent of input path
  • architectural_design: share ARCH_VIEWS, narrow view_root_indexes, cleanup
  • dependable_element: unconditional label prefixing, view refs as dict, staged-path collision tests
  • fix docs failures

- puml_utils.bzl: rewrite make_puml_rst_navigation to emit one directory-
  structured index.rst tree per view (mirroring source layout)
- architectural_design.bzl: loop over the four views (static/dynamic/
  public_api/internal_api) generically Colocate
  every view file (not just puml) preserving relative directory structure.
  Redesign the returned SphinxSourcesInfo so srcs holds only each view's
  root index
- providers.bzl: replace the four separate *_doc_files fields on
  ArchitecturalDesignInfo with a single view_indexes dict (view name ->
  navigation struct or None) reflecting the generic per-view design.
Every write_*_to_file helper (FlatBuffers, lobster, idmap) derives its
output filename from the passed-in input path's file stem alone. Add
--output-stem <STEM> so a caller that needs a specific, disambiguated
output filename (e.g. a Bazel rule staging same-named diagrams from
different packages) can request it directly, instead of having to stage
the actual input file under a symlink named after the desired stem.
…anup

- Extract the static/dynamic/public_api/internal_api view list into a new
  shared bazel/rules/rules_score/private/views.bzl
- Narrow ArchitecturalDesignInfo.view_indexes (Dict[str, NavigationStruct])
  to view_root_indexes (Dict[str, File|None])
- _colocate_view_files now returns Dict[str, File] keyed by relative path
  instead of a positionally-matched List[File]; emit_view_navigation takes
  that dict directly instead of rebuilding it internally from a zipped list.
- relative_source_path reads file.owner directly instead of
  getattr(file, "owner", None) -- test fakes always set it.
- Collapse the redundant view_fbs/view_fbs_files dicts in
  architectural_design.bzl into one.
- Trim the architectural_design() macro's docstring, pointing to
  docs/user_guide/architectural_design.rst instead of duplicating its
  authoring-mode prose.
- Replace the bespoke puml_layout_crash_repro_test.bzl analysistest rule
  with skylib's build_test for the two "does it build" regression fixtures.
- Add a diagram-free view regression test (authored_layout_diagram_free_test):
  a view with only a hand-authored index.md and no diagrams at all must still
  stage a valid root index (authored body composed above an empty toctree).
- Add stem_collision_fails_test: an expect_failure analysistest covering
  _disambiguated_stems' residual-collision fail() path (two files whose
  basenames collide and whose directory-disambiguated stems collide too).
… staged-path collision tests

- _process_artifact_type: removed the use_label_subdirectories = len(attr_list)
  > 1 conditional. Every label attached to an artifact-type attribute
  (assumptions_of_use, dependability_analysis, checklists, glossary) now gets
  an unconditional "<target_name>/" staging prefix
- Applied the same unconditional "<target_name>/" prefix to the
  feature_requirements and assumed_system_requirements loops (previously
  staged with no prefix at all, regardless of how many requirements targets
  were attached).
- _process_architectural_design_files: collapsed its 6-tuple return
  (output_files, static_refs, dynamic_refs, public_api_refs,
  internal_api_refs, unclassified_refs) to (output_files, refs_by_view,
  unclassified_refs), with refs_by_view keyed generically over ARCH_VIEWS.
- Fixed a latent bug in _check_staged_path's callers: a detected collision
  was only recorded in `errors` for a later fail(), but the colliding file's
  declare_file()/symlink() actions were still unconditionally registered --
  so two genuinely different source files staging to the same path tripped
  Bazel's own ActionConflictException before this rule's fail() was ever
  reached
- Added 2 regression tests
- Extracted test/lib/find_runfile.sh
…ctions

- examples/seooc/design/BUILD, index.md: the "standalone page" example file
  arch_design.rst no longer exists in this exampl
- docs/user_guide/architectural_design.rst: fixed the "working demonstration
  of all three modes"
@github-actions

Copy link
Copy Markdown

Coverage Report

Coverage report was generated.

Full report can be downloaded from the CI artifacts (expand Artifacts at the bottom of the run).

Overall coverage rate:

lines......: 86.2%
functions......: 55.0%

@LittleHuba LittleHuba left a comment

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.

Finding is no blocker IMHO. Potentially relevant for a follow-up. @hoe-jo let's talk about this.

Comment on lines +166 to +170
- Directory levels that hold nothing of their own and lead to a single
subdirectory are skipped, so a diagram at ``foo/bar/baz.puml`` is reached
through one ``foo/bar/index.rst`` rather than a chain of navigation pages
that each contain a single link. A view consisting of one page and nothing
else gets no generated index at all; that page becomes the view's root.

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.

That could be weird when you slowly migrate to rules_score.

@LittleHuba
LittleHuba merged commit f78a21c into main Sep 17, 2026
17 checks passed
@LittleHuba
LittleHuba deleted the joho_rework_design_structure branch September 17, 2026 10:11
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.

2 participants