|
| 1 | +#!/usr/bin/env bash |
| 2 | +set -euo pipefail |
| 3 | + |
| 4 | +# Create or update a GitHub Projects (beta) board that tracks the nostr-java 1.0 roadmap. |
| 5 | +# Requires: GitHub CLI 2.32+ with project commands enabled and an authenticated session. |
| 6 | + |
| 7 | +project_title="nostr-java 1.0 Roadmap" |
| 8 | + |
| 9 | +if!command -v gh>/dev/null2>&1;then |
| 10 | +echo"GitHub CLI (gh) is required to run this script.">&2 |
| 11 | +exit 1 |
| 12 | +fi |
| 13 | + |
| 14 | +if!command -v jq>/dev/null2>&1;then |
| 15 | +echo"jq is required to parse GitHub CLI responses.">&2 |
| 16 | +exit 1 |
| 17 | +fi |
| 18 | + |
| 19 | +repo_json=$(gh repo view --json nameWithOwner,owner --jq'{nameWithOwner, owner_login: .owner.login}'2>/dev/null|| true) |
| 20 | +if [[-z"${repo_json}" ]];then |
| 21 | +echo"Unable to determine repository owner via 'gh repo view'. Ensure you are within a cloned repo or pass --repo.">&2 |
| 22 | +exit 1 |
| 23 | +fi |
| 24 | + |
| 25 | +repo_name_with_owner=$(jq -r'.nameWithOwner'<<<"${repo_json}") |
| 26 | +repo_owner=$(jq -r'.owner_login'<<<"${repo_json}") |
| 27 | + |
| 28 | +# Look up an existing project with the desired title. |
| 29 | +project_number=$(gh project list --owner"${repo_owner}" --format json| |
| 30 | + jq -r --arg title"${project_title}"'map(select(.title == $title)) | first | .number // empty') |
| 31 | + |
| 32 | +if [[-z"${project_number}" ]];then |
| 33 | +echo"Creating project '${project_title}' for owner${repo_owner}" |
| 34 | + gh project create --owner"${repo_owner}" --title"${project_title}" --format json>/tmp/project-create.json |
| 35 | + project_number=$(jq -r'.number' /tmp/project-create.json) |
| 36 | +echo"Created project #${project_number}" |
| 37 | +else |
| 38 | +echo"Project '${project_title}' already exists as #${project_number}." |
| 39 | +fi |
| 40 | + |
| 41 | +add_task() { |
| 42 | +local title="$1" |
| 43 | +local body="$2" |
| 44 | +echo"Ensuring draft item:${title}" |
| 45 | + gh project item-add --owner"${repo_owner}" --project"${project_number}" --title"${title}" --body"${body}" --format json>/dev/null |
| 46 | +} |
| 47 | + |
| 48 | +add_task"Remove deprecated constants facade""Delete nostr.config.Constants.Kind before 1.0. See docs/explanation/roadmap-1.0.md." |
| 49 | +add_task"Retire legacy encoder singleton""Drop Encoder.ENCODER_MAPPER_BLACKBIRD after migrating callers to EventJsonMapper." |
| 50 | +add_task"Drop deprecated NIP overloads""Purge for-removal overloads in NIP01 and NIP61 to stabilize fluent APIs." |
| 51 | +add_task"Remove deprecated tag constructors""Clean up GenericTag and EntityFactory compatibility constructors." |
| 52 | +add_task"Cover all relay command decoding""Extend BaseMessageDecoderTest and BaseMessageCommandMapperTest fixtures beyond REQ." |
| 53 | +add_task"Stabilize NIP-52 calendar integration""Re-enable flaky assertions in ApiNIP52RequestIT with deterministic relay handling." |
| 54 | +add_task"Stabilize NIP-99 classifieds integration""Repair ApiNIP99RequestIT expectations for NOTICE/EOSE relay responses." |
| 55 | +add_task"Complete migration checklist""Fill MIGRATION.md deprecated API removals section before cutting 1.0." |
| 56 | +add_task"Document dependency alignment plan""Record and streamline parent POM overrides tied to 0.6.5-SNAPSHOT." |
| 57 | +add_task"Plan version uplift workflow""Outline tagging and publishing steps for the 1.0.0 release in docs." |
| 58 | + |
| 59 | +cat<<INFO |
| 60 | +Project setup complete. |
| 61 | +If tasks already existed as draft items, duplicates may appear; manually consolidate as needed. |
| 62 | +INFO |