Skip to content

ENT-14128: Made autolinking fail loudly, added script to build locally, and fixed broken links and other build issues#3655

Merged
olehermanse merged 7 commits into
cfengine:masterfrom
olehermanse:build-locally
Jun 18, 2026
Merged

ENT-14128: Made autolinking fail loudly, added script to build locally, and fixed broken links and other build issues#3655
olehermanse merged 7 commits into
cfengine:masterfrom
olehermanse:build-locally

Conversation

@olehermanse

@olehermanse olehermanse commented May 20, 2026

Copy link
Copy Markdown
Member

Ticket: ENT-14128

@olehermanse olehermanse changed the title build locally Attempt to build locally and fix issues with autolinking May 20, 2026
@olehermanse olehermanse force-pushed the build-locally branch 2 times, most recently from 3c5e6c5 to 4f5cb7c Compare May 20, 2026 23:50
@olehermanse

Copy link
Copy Markdown
Member Author

@cf-bottom jenkins, please

@cf-bottom

Copy link
Copy Markdown

@olehermanse olehermanse force-pushed the build-locally branch 3 times, most recently from a51430b to 3e15a15 Compare May 21, 2026 14:17
@olehermanse olehermanse force-pushed the build-locally branch 2 times, most recently from c528839 to 28f8f20 Compare June 15, 2026 23:14
@olehermanse

Copy link
Copy Markdown
Member Author

@cf-bottom jenkins

@cf-bottom

Copy link
Copy Markdown

@olehermanse olehermanse changed the title Attempt to build locally and fix issues with autolinking ENT-14128: Attempt to build locally and fix issues with autolinking Jun 15, 2026
olehermanse and others added 7 commits June 18, 2026 13:06
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Ole Herman Schumacher Elgesem <ole@northern.tech>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Ole Herman Schumacher Elgesem <ole@northern.tech>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Ole Herman Schumacher Elgesem <ole@northern.tech>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Ole Herman Schumacher Elgesem <ole@northern.tech>
This file was growing with more and more content which caused
errors during build, like broken links.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Ole Herman Schumacher Elgesem <ole@northern.tech>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Ole Herman Schumacher Elgesem <ole@northern.tech>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Ole Herman Schumacher Elgesem <ole@northern.tech>
@olehermanse olehermanse marked this pull request as ready for review June 18, 2026 11:14
@olehermanse olehermanse changed the title ENT-14128: Attempt to build locally and fix issues with autolinking ENT-14128: Made autolinking fail loudly, added script to build locally, and fixed broken links and other build issues Jun 18, 2026
@olehermanse

Copy link
Copy Markdown
Member Author

@cf-bottom jenkins, please

@cf-bottom

Copy link
Copy Markdown

@aleksandrychev aleksandrychev 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.

nice work

@nickanderson nickanderson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seemed ok to me, one of my ai friends says:

  - Fence logic is now hand-duplicated in 3 places (cfdoc_linkresolver.applyLinkMap, cfdoc_references_resolver.process, cfdoc_macros.prune_include_lines) with slight variations. It's correct in each, but it's the kind of thing that drifts. A small shared generator (for line, in_pre 
  in iter_fence_state(lines)) would de-risk future edits. Non-blocking.
  - Ambiguous titles resolve silently to whichever page parsed last. There are two pages titled Installing CFEngine and two titled Promises. load_references builds a dict keyed by lowercased ref, so the last-appended URL wins with no warning. The applyLinkMap path does emit a
  "Multiple link targets" warning for backtick autolinks, but the [text][ref] path doesn't. Since this PR is specifically about making link resolution trustworthy, it'd be a natural place to also warn on duplicate-title collisions — though it's a pre-existing quirk, fine to defer.
  - build-locally.sh clones over SSH (git@github.com:). Contributors without GitHub SSH keys will fail at step 1. An HTTPS fallback (or a one-line note in the header comment) would help. The --exclude='/tmp/' to stop rsync recursing into its own output dir is a nice catch.
  - Minor comment nit: _no_links.md's header says "Lines starting with <!--/blank lines are ignored," but the parser actually strips full <!-- ... --> blocks via re.DOTALL — i.e. it's more robust than documented. Trivial.

if line.lstrip().startswith("```"):
in_pre = not in_pre
stripped = line.lstrip()
# Track fenced code blocks the way CommonMark/Hugo do, so we skip exactly

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.

this looks like the same comment as in generator/_scripts/cfdoc_linkresolver.py might be nice to refactor at some point.

@olehermanse olehermanse merged commit 4aec03e into cfengine:master Jun 18, 2026
2 checks passed
@olehermanse olehermanse deleted the build-locally branch June 18, 2026 14:31
@olehermanse

Copy link
Copy Markdown
Member Author

#3693

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants