Skip to content

Avoid unnecessary workflows, improve check-links detection of Hugo site dir#667

Open
alexander-yevsyukov wants to merge 14 commits into
masterfrom
avoid-unnecessary-workflows
Open

Avoid unnecessary workflows, improve check-links detection of Hugo site dir#667
alexander-yevsyukov wants to merge 14 commits into
masterfrom
avoid-unnecessary-workflows

Conversation

@alexander-yevsyukov
Copy link
Copy Markdown
Contributor

@alexander-yevsyukov alexander-yevsyukov commented May 25, 2026

This PR delivers several improvements across migrate, the check-links workflow, and the check-links / pre-pr skills.

migrate script

  1. Hugo site detection expanded — now checks config/hugo.{toml,yaml} and config/_default/hugo.{toml,yaml} in addition to the site root, matching the detection logic in the check-links workflow.

  2. JVM detection made reliable — uses the presence of buildSrc/src/main/kotlin/io/spine/dependency as the marker instead of gradlew / build.gradle.kts, which can exist in non-JVM repos that wrap shell scripts in Gradle for convenience.

  3. Script restructured for mixed projects — the previous binary if IS_HUGO_DOCS … else … fi assumed a repo is either Hugo or JVM. Repos such as validation are both. The script is now four independent, sequentially-executed sections (Common, .agents, .claude, Hugo-specific, JVM-specific), each guarded by its own flag. Both IS_HUGO_DOCS and IS_JVM can be true simultaneously, and each section applies the right operations for the detected combination.

check-links workflow

  1. work_dir output added — the "Detect docs site" step now emits a work_dir output (either $dir/_preview or $dir) so that all downstream steps use the correct working directory for npm ci, hugo, and Lychee, regardless of whether the repo's Node/Hugo setup lives in a _preview/ subtree or at the site root.

  2. Unused site_dir output removed — no downstream step referenced it; it is dropped to keep the step contract minimal.

  3. YAML config subdir variants addedconfig/hugo.yaml and config/_default/hugo.yaml are now included in the detection loop alongside the TOML variants.

check-links skill

  1. WORK_DIR detection added to step 0 — mirrors the workflow's _preview vs. site-root logic so that local pre-PR runs and CI use the same working directory.

  2. All ${SITE_DIR}/_preview references replaced with ${WORK_DIR} — affects npm ci, hugo build, hugo server, Lychee invocation, path-mapping example, and the Notes section.

  3. Config subdir detection aligned with the workflow — step 0 now checks the same six config paths.

pre-pr skill

  1. Description corrected — the previous wording claimed "deps-only → skipped"; dependency files (*.kt/*.kts under buildSrc) match the code classifier and run ./gradlew build. The description now reads "code/deps → build".

Scripts

  1. jq presence check added — scripts that use jq now verify it is installed and exit with a clear error if not.

@alexander-yevsyukov alexander-yevsyukov changed the title Avoid unnecessary workflows Avoid unnecessary workflows, improve check-links detection of Hugo site dir May 25, 2026
@alexander-yevsyukov alexander-yevsyukov marked this pull request as ready for review May 25, 2026 18:03
@alexander-yevsyukov alexander-yevsyukov self-assigned this May 25, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves repo-type detection used by shared tooling so that GitHub workflows and the check-links job behave correctly across different Spine repository layouts (JVM vs Hugo-only docs sites).

Changes:

  • Add a more reliable JVM/Gradle repository marker in migrate and gate workflow updates behind it.
  • Enhance check-links workflow Hugo site detection to support additional Hugo config layouts and to choose the correct working directory (_preview/ vs site root).
  • Refine the pre-pr skill description to reflect scope-dependent build/check behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
migrate Adds JVM repo detection and conditionally updates JVM-specific GitHub workflows.
.github/workflows/check-links.yml Improves Hugo site/config discovery and introduces work_dir to run Node/Hugo steps in the right directory.
.agents/skills/pre-pr/SKILL.md Updates the skill description to better describe scope-based build/check behavior and invoked reviewers.

Comment thread .github/workflows/check-links.yml
Comment thread .agents/skills/pre-pr/SKILL.md Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 149c14158d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread migrate
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 5 changed files in this pull request and generated 3 comments.

Files not reviewed (2)
  • .idea/live-templates/README.md: Language not supported
  • .idea/misc.xml: Language not supported

Comment thread migrate Outdated
Comment thread .github/workflows/check-links.yml Outdated
Comment thread .github/workflows/check-links.yml Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 13 changed files in this pull request and generated 1 comment.

Files not reviewed (3)
  • .idea/live-templates/README.md: Language not supported
  • .idea/live-templates/User.xml: Language not supported
  • .idea/misc.xml: Language not supported
Comments suppressed due to low confidence (1)

migrate:159

  • initialize .github copies the entire .github/ directory (including .github/workflows/*) into the target repo when it doesn't exist yet. Because workflow syncing is now gated behind IS_JVM, a non-JVM target with no pre-existing .github/ will still receive JVM-only workflows like detekt-code-analysis.yml / gradle-wrapper-validation.yml from this initial copy. Consider copying .github/ without workflows (or removing JVM workflows) when IS_JVM=false, and only populating .github/workflows inside the JVM-gated block.
    initialize .github

    echo "Updating Codecov settings"
    cp .codecov.yml ..

Comment thread migrate Outdated
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