test: mock Confluence API in CI instead of live instance - #11
Merged
Conversation
The Test workflow ran the action against a real Confluence space, so it failed whenever that space or its secrets changed. Add an in-memory mock Confluence server and point the workflow at it with fake credentials so the test is hermetic. Allow the host input to carry a scheme so it can target the local mock while bare hostnames still default to https. Assisted-By: Claude Opus 4.8
📝 WalkthroughWalkthroughThe action now accepts scheme-aware Confluence hosts and routes all API calls through a normalized base URL. The test workflow starts a configurable local mock server and runs the action against it using fixed test values. ChangesConfluence local testing
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant TestWorkflow
participant MockConfluence
participant Action
TestWorkflow->>MockConfluence: Start server on port 8080
TestWorkflow->>MockConfluence: Poll space endpoint
MockConfluence-->>TestWorkflow: Return availability response
TestWorkflow->>Action: Run with localhost host and test identifiers
Action->>MockConfluence: Call normalized Confluence REST URLs
MockConfluence-->>Action: Return and update page data
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@action.yml`:
- Around line 54-59: Update the host normalization block in the action script to
pass inputs.host through the step environment rather than interpolating it into
shell code, reject carriage returns and newlines before processing, and use
printf when writing confluenceBaseUrl to GITHUB_ENV. Preserve the existing
http/https detection and default https:// prefix behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 9d6fd2e5-5e95-471c-8a06-27fa3f4a8655
📒 Files selected for processing (3)
.github/workflows/test.yamlaction.ymltest/mock_confluence_server.py
nmoinvaz
force-pushed
the
test/mock-confluence-server
branch
from
July 24, 2026 18:25
34cd5ac to
e12e464
Compare
nmoinvaz
enabled auto-merge (rebase)
July 24, 2026 18:28
steve-tucker
approved these changes
Jul 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Test workflow ran the whole action against a real Confluence space on
solidstatenetworks.jira.comusing repo secrets. It started failing when that space was removed, returning404 No space found with keyat the Get Space ID step, unrelated to any code change.This adds an in-memory mock Confluence server (
test/mock_confluence_server.py) covering the four endpoints the action calls, mirroring the mock pattern already used injira-version-action. The workflow starts it on localhost and runs the action with fake credentials, so the test no longer depends on live infrastructure or secrets.The action hardcoded
https://in its curl URLs, soaction.ymlnow normalizes the host: a bare hostname still defaults tohttps, but a host that includes a scheme is left as-is, letting the workflow targethttp://localhost:8080.Summary by CodeRabbit
New Features
Bug Fixes
Tests