Allow Challenge Authors to Create and View Writeups Without Solving the Challenge#14
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
Pull request overview
Enables challenge creators (authors) to create writeups and view writeup contents for their own challenges even if they haven’t solved the challenge, aligning backend authorization, frontend gating, documentation, and tests with the new rule.
Changes:
- Backend: centralize writeup-content access checks to allow challenge creators OR solvers to view/create writeups.
- Tests: add service-level and HTTP integration coverage for creator access and repo failure paths.
- Frontend/docs: update UI gating for writeup creation and document the new
can_view_contentsemantics.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/service/wargame_service.go | Adds creator-aware access checks for writeup creation and content visibility; refactors multiple endpoints to use shared helpers. |
| internal/service/wargame_service_test.go | Adds unit/service tests for creator access and error propagation on repo failures. |
| internal/http/integration/writeups_test.go | Adds integration test verifying creator can create/view writeups without solving. |
| frontend/src/routes/WriteupEditor.tsx | Allows writeup editing when user is solver or challenge creator. |
| frontend/src/routes/ChallengeDetail.tsx | Allows showing “Create writeup” entrypoint when user is solver or challenge creator. |
| frontend/src/App.tsx | Introduces an unreachable “maintenance” UI block (currently if (false)). |
| docs/docs/writeups.md | Documents creator access behavior for can_view_content and writeup creation rules. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Previously, even challenge authors had to solve their own challenge in order to create a writeup or view writeups written by other users.
This PR changes the behavior so that challenge authors can create and view writeups regardless of whether they have solved the challenge.