Skip to content

refactor: make join_path tolerate optional segments - #862

Open
AlexanderLanin wants to merge 2 commits into
mainfrom
stack/pr0-join-path
Open

AlexanderLanin wants to merge 2 commits into
mainfrom
stack/pr0-join-path

Conversation

@AlexanderLanin

@AlexanderLanin AlexanderLanin commented Sep 26, 2026 •

Copy link
Copy Markdown
Member

Why

Optional Bazel path segments are used by the documentation configuration and URL handling. join_path previously assumed both inputs were strings, so callers needed defensive handling for absent segments.

What changed

join_path now treats None like an empty path segment while preserving the existing trailing-slash and dot-segment normalization. The tests cover absent and empty prefix/rest segments.

@github-actions

Copy link
Copy Markdown
Contributor

Documentation preview for this pull request is available at:
pr-862: https://eclipse-score.github.io/docs-as-code/pr-862/

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The implementation unintentionally accepts all falsy values, and its documentation contradicts trailing-slash normalization.

Review effort: Balanced
Findings: 1 Low severity

Open (1)
What changed in this PR

Updates join_path to support optional path segments while retaining normalization.

Changes:

  • Converts absent segments to empty paths.
  • Adds regression tests for None and empty segments.
  • Updates helper documentation.
File Description
bzl/​basics.bzl Adds optional-segment handling and documentation.
bzl/​tests/​basics_test.bzl Covers absent and empty segment combinations.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread bzl/basics.bzl Outdated
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