Skip to content

fix(part-managed): native files without github_repo - #1047

Open
VelmiraS wants to merge 1 commit into
masterfrom
fix/part-managed-native-local
Open

fix(part-managed): native files without github_repo#1047
VelmiraS wants to merge 1 commit into
masterfrom
fix/part-managed-native-local

Conversation

@VelmiraS

@VelmiraS VelmiraS commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

What this PR does / why we need it:

post-processing/part-managed.js classified native blog posts (files committed directly to this repo, never processed by docforge) as managed: true instead of local: true. This broke the "Edit this page" button — it pointed to an upstream repo instead of the correct location in gardener/documentation.

Root cause: seedClassification only returned 'local' for files matching LOCAL_SUBDIR_PATTERN (website/...) or LOCAL_PATH_ALLOWLIST. Files without a github_repo field fell through to return 'managed'.

Fix: add an early return — if github_repo is absent, docforge never processed the file, so it is native to this repo and must be local: true.

Also corrects the existing misclassification of hugo/content/blog/2026/07/07-23-machine-preservation-on-failure-in-gardener.md, which was marked managed: true by a previous run of the unfixed script.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

The seedClassification change affects only files that have no local/managed marker yet (new files). Existing correctly-classified files are not re-evaluated. The data fix for the 07-23 blog post is a one-time correction for an already-misclassified file — future native blog posts will be classified correctly from the first script run.

Summary by CodeRabbit

  • Bug Fixes
    • Improved file classification for entries without a valid repository identifier.
    • Ensured repository and subdirectory metadata are both matched before files are classified as local.

@VelmiraS
VelmiraS requested a review from a team as a code owner August 13, 2026 06:46
@netlify

netlify Bot commented Aug 13, 2026

Copy link
Copy Markdown

Deploy Preview for gardener-docs ready!

Name Link
🔨 Latest commit 05ae880
🔍 Latest deploy log https://app.netlify.com/projects/gardener-docs/deploys/6a7d6859eaf7db00087cdf74
😎 Deploy Preview https://deploy-preview-1047--gardener-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@gardener-prow gardener-prow Bot added do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 13, 2026
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro Plus

Run ID: 425e6944-560f-4447-b5e4-181bc8b64f25

📥 Commits

Reviewing files that changed from the base of the PR and between c264afe and 05ae880.

⛔ Files ignored due to path filters (1)
  • hugo/content/blog/2026/07/07-23-machine-preservation-on-failure-in-gardener.md is excluded by !hugo/content/**
📒 Files selected for processing (1)
  • post-processing/part-managed.js

📝 Walkthrough

Walkthrough

seedClassification now classifies files without a string github_repo as local. Files with repository metadata must match the repository and local subdirectory patterns.

Changes

File classification

Layer / File(s) Summary
Local classification logic
post-processing/part-managed.js
Files without string github_repo values are classified as local. Repository matching occurs before github_subdir validation. Local classification still requires matching repository and subdirectory patterns when repository metadata exists.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Mergeability Score: ⚪ Minimal · up to 05ae8

This localized change corrects native-file classification and the affected blog post metadata. No actionable merge-blocking risk remains beyond normal checks and review.

Suggested reviewers: bohristova

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the fix for native files without a github_repo field.
Description check ✅ Passed The description explains the problem, root cause, fix, impact, and reviewer notes; only the kind and issue fields remain placeholders.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/part-managed-native-local

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gardener-prow

gardener-prow Bot commented Aug 13, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign marc1404 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@klocke-io

klocke-io commented Aug 13, 2026

Copy link
Copy Markdown
Member

Hi @VelmiraS

This broke the "Edit this page" button — it pointed to an upstream repo instead of the correct location in gardener/documentation.

I'm unsure to which upstream repo you are referring, for the 07-23-machine-preservation-on-failure-in-gardener.md blog post, the missing front matter field github_repo leads to a missing edit this page button on the page.
image

I think the issue is that we cannot expect a contributor to fill out this cryptic frontmatter.

to fix the classification issue. I would recommend a one-time cleaning off all local files, to remove all of those fields:

github_repo: 'https://github.com/gardener/documentation'
github_subdir: hugo/content/blog/2026/07
linkTitle: 'Gardener Landscape Kit v0.2.0: GitOps-Native Landscape Management'
newsSubtitle: 'July 08, 2026'
params:
  github_branch: master
path_base_for_github_subdir:
  from: >-
    content/blog/2026/07/07-08-gardener-landscape-kit-v020-gitops-native-landscape-management.md
  to: 07-08-gardener-landscape-kit-v020-gitops-native-landscape-management.md

and then to also remove

local: true/false
managed: true/false

We just infer it from the frontmatter. If a file has a github_repo: in the frontmatter its managed; if not its local. The only thing we need to update is the editThisPageFunction in .vitepress/config.mts to treat files without github_repo differently.

This would also allow us to drop post-processing/part-managed.js then we update the check-managed.mjs to guard based on github_repo in the frontmatter.

what do you think?

@VelmiraS

Copy link
Copy Markdown
Collaborator Author

Thanks for the detailed feedback! I opened a PR with a small fix that addresses the current issue. I agree that the proposed refactor to drop the local/managed markers and infer everything directly from github_repo in config.mts and check-managed.mjs makes sense as a longer-term cleanup.

@klocke-io

klocke-io commented Aug 17, 2026

Copy link
Copy Markdown
Member

@VelmiraS I am not sure, this would really improve the situation.

I implemented a full fix in https://github.com/gardener/documentation/tree/fix/index-rename-and-classification and will open a PR within the next two days for it.

@klocke-io

Copy link
Copy Markdown
Member

or should I push it into this PR?

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

Labels

cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants