Skip to content

ci(docs): add PR docs preview workflow and enforce develop as default base branch#84

Merged
RussellSB merged 8 commits intodevelopfrom
copilot/add-temporary-docs-deploy
Apr 4, 2026
Merged

ci(docs): add PR docs preview workflow and enforce develop as default base branch#84
RussellSB merged 8 commits intodevelopfrom
copilot/add-temporary-docs-deploy

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 4, 2026

  • Create .github/workflows/docs-preview.yaml for PR docs previews
  • Update .github/copilot-instructions.md to mandate develop as default base branch
  • Fix spurious pyproject.toml/CHANGELOG.md diffs by aligning branch with develop
  • Address review bot comments:
    • Use stable hidden HTML marker <!-- docs-preview-bot --> for comment lookup so deploy/cleanup jobs always find the same comment regardless of its current text
    • Include the stable marker in the cleanup comment body to survive future re-deploys
    • Add git pull --rebase origin gh-pages before push in cleanup to prevent non-fast-forward failures when concurrent jobs push to gh-pages

@RussellSB RussellSB changed the base branch from main to develop April 4, 2026 22:07
Agent-Logs-Url: https://github.com/RussellSB/pytrendy/sessions/3993dd13-fd55-4617-9e8b-0682b3c54b42

Co-authored-by: RussellSB <35470600+RussellSB@users.noreply.github.com>
Copilot AI changed the title [WIP] Add temporary deployment for documentation changes ci(docs): add PR docs preview workflow Apr 4, 2026
Copilot AI requested a review from RussellSB April 4, 2026 22:11
@RussellSB RussellSB requested a review from Copilot April 4, 2026 22:16
Copy link
Copy Markdown
Owner

@RussellSB RussellSB left a comment

Choose a reason for hiding this comment

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

Nitpick: is the git diff in pyproject.toml and changelog.md releveant to this PR? This might have come when the base branch was main, and I manually changed it to dev.

Investigate this, and so this doesn't happen with shenanigans, make sure that the base branch for agent PR requests is develop by default. Update the copilot skill for this

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

Adds a GitHub Actions workflow to build and publish per-PR documentation previews to GitHub Pages, with automated cleanup on PR close. The PR also includes a version bump and changelog entry that appear unrelated to the stated docs-preview purpose.

Changes:

  • Add .github/workflows/docs-preview.yaml to deploy PR-scoped MkDocs builds to gh-pages/pr-{N}/ and comment the preview URL on the PR.
  • Add a cleanup job to remove pr-{N}/ from gh-pages when the PR is closed.
  • Update pyproject.toml version and prepend a new CHANGELOG.md entry.

Reviewed changes

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

File Description
.github/workflows/docs-preview.yaml New PR docs preview + teardown workflow targeting gh-pages/pr-{N}/ with PR commenting.
pyproject.toml Bumps project version to 1.1.11.
CHANGELOG.md Adds a new 1.1.11 release section at the top.

Comment thread pyproject.toml
Comment thread CHANGELOG.md Outdated
Comment thread .github/workflows/docs-preview.yaml
Comment thread .github/workflows/docs-preview.yaml Outdated
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: botComment.id,
body: `📚 **Docs preview removed**\n\nThe docs preview for this PR has been cleaned up.`,
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

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

Cleanup updates the PR comment body to 'Docs preview removed', which removes the 'Docs preview deployed' text used by the deploy job to locate and update the existing comment. This makes it likely that the next deploy will post a duplicate comment instead of updating the existing one. Keep the same marker text (or a hidden marker) in both the deploy and cleanup comment bodies so the comment remains discoverable.

Suggested change
body: `📚 **Docs preview removed**\n\nThe docs preview for this PR has been cleaned up.`,
body: `<!-- Docs preview deployed -->\n📚 **Docs preview removed**\n\nThe docs preview for this PR has been cleaned up.`,

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/docs-preview.yaml
Comment thread pyproject.toml
Copilot AI and others added 3 commits April 4, 2026 22:22
Co-authored-by: RussellSB <35470600+RussellSB@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 4, 2026

Nitpick: is the git diff in pyproject.toml and changelog.md releveant to this PR? This might have come when the base branch was main, and I manually changed it to dev.

Investigate this, and so this d...

The spurious diffs were caused by the branch being forked from main at v1.1.11 rather than from develop (which is still at v1.1.10). When the PR base was manually changed to develop, those release-only changes showed up in the diff.

Fixed in commits 43e186a and 378b1bf:

  1. pyproject.toml and CHANGELOG.md are now aligned with develop's state so the PR diff is clean.
  2. .github/copilot-instructions.md has a new Default Base Branch section instructing Copilot to always branch off and target develop for all future PRs.

Copilot AI changed the title ci(docs): add PR docs preview workflow ci(docs): add PR docs preview workflow and enforce develop as default base branch Apr 4, 2026
Copilot AI requested a review from RussellSB April 4, 2026 22:27
…e push in cleanup

Agent-Logs-Url: https://github.com/RussellSB/pytrendy/sessions/69f331ee-6fb1-4c47-b39c-ec62bf26f807

Co-authored-by: RussellSB <35470600+RussellSB@users.noreply.github.com>
@RussellSB RussellSB marked this pull request as ready for review April 4, 2026 23:20
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@RussellSB RussellSB merged commit c7ece33 into develop Apr 4, 2026
2 checks passed
@RussellSB RussellSB deleted the copilot/add-temporary-docs-deploy branch April 4, 2026 23:44
Copilot AI added a commit that referenced this pull request Apr 5, 2026
and enforce develop as default base branch in copilot instructions
Co-authored-by: RussellSB <35470600+RussellSB@users.noreply.github.com>
RussellSB added a commit that referenced this pull request Apr 5, 2026
and enforce develop as default base branch in copilot instructions

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
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.

4 participants