Skip to content

Allow Challenge Authors to Create and View Writeups Without Solving the Challenge#14

Merged
yulmwu merged 3 commits into
mainfrom
feat/writeup-fix
May 18, 2026
Merged

Allow Challenge Authors to Create and View Writeups Without Solving the Challenge#14
yulmwu merged 3 commits into
mainfrom
feat/writeup-fix

Conversation

@yulmwu
Copy link
Copy Markdown
Member

@yulmwu yulmwu commented May 18, 2026

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.

@yulmwu yulmwu added the enhancement New feature or request label May 18, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 18, 2026

Codecov Report

❌ Patch coverage is 86.48649% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/service/wargame_service.go 86.11% 2 Missing and 3 partials ⚠️

📢 Thoughts on this report? Let us know!

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

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_content semantics.

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.

Comment thread internal/service/wargame_service.go Outdated
Comment thread frontend/src/App.tsx
Comment thread frontend/src/routes/ChallengeDetail.tsx Outdated
@yulmwu yulmwu merged commit f37be31 into main May 18, 2026
2 checks passed
@yulmwu yulmwu deleted the feat/writeup-fix branch May 18, 2026 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants