2026-07-12 19:54:08 +00:00
|
|
|
require_relative "test_helper"
|
|
|
|
|
|
|
|
|
|
class TrackerTest < Minitest::Test
|
Retire Planka: os-backlog reworked to git-issues-only (ADR-0042)
Executes OpenSpec change retire-planka-git-issues-only (archived, 25/25 tasks):
- os-backlog v0.3.0: Planka lib/CLI/agents deleted; issue-create/issues
helpers (tea/gh/repo-file dispatch); ten-label taxonomy, human-only next
- planka: rejected fail-soft citing ADR-0042 in tracker grammar,
config-write, and the os-status check
- Skills, SessionStart note (~687 -> ~444 tokens), /to-issues, os-status fix
rewritten to the single-tracker model
- All boards snapshotted + pg-dumped (ovh-vps ~/planka-final-snapshot-2026-07-16);
cards migrated to jared/cc-os#61-70, jared/ops#1-21, jared/llf-schema#7-10
- Planka server decommissioned; planka gem repo archived read-only
- Delta specs synced to openspec/specs/ (issue-backlog, issue-state-labels)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014HWNfGWoWnhrub4EJa1M1Y
2026-07-16 19:48:40 +00:00
|
|
|
def test_rejects_planka_format
|
|
|
|
|
refute Backlog::Tracker.valid?("planka:llf-schema")
|
|
|
|
|
assert_nil Backlog::Tracker.kind("planka:llf-schema")
|
2026-07-12 19:54:08 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def test_accepts_forgejo_format
|
|
|
|
|
assert Backlog::Tracker.valid?("forgejo:jared/cc-os")
|
|
|
|
|
assert_equal :forgejo, Backlog::Tracker.kind("forgejo:jared/cc-os")
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def test_accepts_github_format
|
|
|
|
|
assert Backlog::Tracker.valid?("github:acme/widget")
|
|
|
|
|
assert_equal :github, Backlog::Tracker.kind("github:acme/widget")
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def test_accepts_repo_format
|
|
|
|
|
assert Backlog::Tracker.valid?("repo:docs/issues")
|
|
|
|
|
assert_equal :repo, Backlog::Tracker.kind("repo:docs/issues")
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def test_rejects_garbage
|
|
|
|
|
refute Backlog::Tracker.valid?("just some text")
|
|
|
|
|
refute Backlog::Tracker.valid?("forgejo:missing-slash")
|
|
|
|
|
refute Backlog::Tracker.valid?("")
|
|
|
|
|
refute Backlog::Tracker.valid?(nil)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def test_rejects_unknown_prefix
|
|
|
|
|
refute Backlog::Tracker.valid?("jira:PROJ-123")
|
|
|
|
|
end
|
|
|
|
|
|
Retire Planka: os-backlog reworked to git-issues-only (ADR-0042)
Executes OpenSpec change retire-planka-git-issues-only (archived, 25/25 tasks):
- os-backlog v0.3.0: Planka lib/CLI/agents deleted; issue-create/issues
helpers (tea/gh/repo-file dispatch); ten-label taxonomy, human-only next
- planka: rejected fail-soft citing ADR-0042 in tracker grammar,
config-write, and the os-status check
- Skills, SessionStart note (~687 -> ~444 tokens), /to-issues, os-status fix
rewritten to the single-tracker model
- All boards snapshotted + pg-dumped (ovh-vps ~/planka-final-snapshot-2026-07-16);
cards migrated to jared/cc-os#61-70, jared/ops#1-21, jared/llf-schema#7-10
- Planka server decommissioned; planka gem repo archived read-only
- Delta specs synced to openspec/specs/ (issue-backlog, issue-state-labels)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014HWNfGWoWnhrub4EJa1M1Y
2026-07-16 19:48:40 +00:00
|
|
|
def test_issues_destination_routes_git_hosts_to_git_issues
|
|
|
|
|
assert_equal :git_issues, Backlog::Tracker.issues_destination("forgejo:jared/cc-os")
|
|
|
|
|
assert_equal :git_issues, Backlog::Tracker.issues_destination("github:jared/cc-os")
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def test_issues_destination_routes_repo_to_repo_files
|
|
|
|
|
assert_equal :repo_files, Backlog::Tracker.issues_destination("repo:docs/issues")
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def test_issues_destination_is_unrouted_for_planka_nil_or_invalid
|
|
|
|
|
assert_equal :unrouted, Backlog::Tracker.issues_destination("planka:cc-os")
|
|
|
|
|
assert_equal :unrouted, Backlog::Tracker.issues_destination(nil)
|
|
|
|
|
assert_equal :unrouted, Backlog::Tracker.issues_destination("jira:whatever")
|
|
|
|
|
end
|
|
|
|
|
|
2026-07-12 19:54:08 +00:00
|
|
|
def test_parse_remote_detects_forgejo_ssh_url
|
|
|
|
|
output = "origin\tssh://git@forgejo.swansoncloud.com:2222/jared/cc-os.git (fetch)\n" \
|
|
|
|
|
"origin\tssh://git@forgejo.swansoncloud.com:2222/jared/cc-os.git (push)\n"
|
|
|
|
|
info = Backlog::Tracker.parse_remote(output)
|
|
|
|
|
assert_equal :forgejo, info[:kind]
|
|
|
|
|
assert_equal "jared", info[:owner]
|
|
|
|
|
assert_equal "cc-os", info[:repo]
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def test_parse_remote_detects_github_https_url
|
|
|
|
|
output = "origin\thttps://github.com/acme/widget.git (fetch)\n"
|
|
|
|
|
info = Backlog::Tracker.parse_remote(output)
|
|
|
|
|
assert_equal :github, info[:kind]
|
|
|
|
|
assert_equal "acme", info[:owner]
|
|
|
|
|
assert_equal "widget", info[:repo]
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def test_parse_remote_detects_github_scp_url
|
|
|
|
|
output = "origin\tgit@github.com:acme/widget.git (fetch)\n"
|
|
|
|
|
info = Backlog::Tracker.parse_remote(output)
|
|
|
|
|
assert_equal :github, info[:kind]
|
|
|
|
|
assert_equal "acme", info[:owner]
|
|
|
|
|
assert_equal "widget", info[:repo]
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def test_parse_remote_classifies_other_hosts_as_unknown
|
|
|
|
|
output = "origin\thttps://gitlab.com/acme/widget.git (fetch)\n"
|
|
|
|
|
info = Backlog::Tracker.parse_remote(output)
|
|
|
|
|
assert_equal :unknown, info[:kind]
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def test_parse_remote_returns_nil_for_blank_output
|
|
|
|
|
assert_nil Backlog::Tracker.parse_remote("")
|
|
|
|
|
assert_nil Backlog::Tracker.parse_remote(nil)
|
|
|
|
|
end
|
|
|
|
|
end
|