issuer 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/README.adoc +1 -1
  3. data/issuer.gemspec +5 -9
  4. data/lib/issuer/cli.rb +5 -5
  5. data/lib/issuer/issue.rb +26 -13
  6. data/lib/issuer/sites/base.rb +2 -1
  7. data/lib/issuer/sites/github.rb +29 -4
  8. metadata +2 -36
  9. data/.rspec +0 -3
  10. data/.vale/config/vocabularies/issuer/accept.txt +0 -63
  11. data/.vale/config/vocabularies/issuer/reject.txt +0 -21
  12. data/.vale.ini +0 -42
  13. data/Dockerfile +0 -43
  14. data/Rakefile +0 -70
  15. data/bin/console +0 -0
  16. data/bin/issuer +0 -13
  17. data/bin/setup +0 -0
  18. data/examples/README.adoc +0 -56
  19. data/scripts/build.sh +0 -40
  20. data/scripts/lint-docs.sh +0 -64
  21. data/scripts/manage-runs.rb +0 -175
  22. data/scripts/pre-commit-template.sh +0 -54
  23. data/scripts/publish.sh +0 -92
  24. data/scripts/setup-vale.sh +0 -59
  25. data/specs/tests/README.adoc +0 -451
  26. data/specs/tests/check-github-connectivity.sh +0 -130
  27. data/specs/tests/cleanup-github-tests.sh +0 -374
  28. data/specs/tests/github-api/01-auth-connection.yml +0 -21
  29. data/specs/tests/github-api/02-basic-issues.yml +0 -90
  30. data/specs/tests/github-api/03-milestone-tests.yml +0 -58
  31. data/specs/tests/github-api/04-label-tests.yml +0 -98
  32. data/specs/tests/github-api/05-assignment-tests.yml +0 -55
  33. data/specs/tests/github-api/06-automation-tests.yml +0 -102
  34. data/specs/tests/github-api/07-error-tests.yml +0 -29
  35. data/specs/tests/github-api/08-complex-tests.yml +0 -197
  36. data/specs/tests/github-api/config.yml.example +0 -17
  37. data/specs/tests/rspec/cli_spec.rb +0 -127
  38. data/specs/tests/rspec/issue_spec.rb +0 -184
  39. data/specs/tests/rspec/issuer_spec.rb +0 -5
  40. data/specs/tests/rspec/ops_spec.rb +0 -124
  41. data/specs/tests/rspec/spec_helper.rb +0 -54
  42. data/specs/tests/run-github-api-tests.sh +0 -424
data/scripts/lint-docs.sh DELETED
@@ -1,64 +0,0 @@
1
- #!/usr/bin/env bash
2
- # Vale linting script for the issuer project
3
-
4
- set -e
5
-
6
- echo "🔍 Running Vale linter on issuer project..."
7
-
8
- # Colors for output
9
- RED='\033[0;31m'
10
- GREEN='\033[0;32m'
11
- YELLOW='\033[1;33m'
12
- NC='\033[0m' # No Color
13
-
14
- # Check if Vale is installed
15
- if ! command -v vale &> /dev/null; then
16
- echo -e "${RED}❌ Vale is not installed. Please install Vale first.${NC}"
17
- echo " You can install it from: https://github.com/errata-ai/vale"
18
- exit 1
19
- fi
20
-
21
- # Check if .vale.ini exists
22
- if [[ ! -f ".vale.ini" ]]; then
23
- echo -e "${RED}❌ .vale.ini not found in current directory${NC}"
24
- echo " Please run this script from the project root."
25
- exit 1
26
- fi
27
-
28
- # Default to checking all relevant files if no arguments provided
29
- if [[ $# -eq 0 ]]; then
30
- FILES=(
31
- "README.adoc"
32
- "lib/examples/*.md"
33
- "specs/tests/*.md"
34
- "*.adoc"
35
- "docs/*.adoc"
36
- )
37
- else
38
- FILES=("$@")
39
- fi
40
-
41
- echo "📁 Files to check: ${FILES[*]}"
42
- echo ""
43
-
44
- # Run Vale
45
- EXIT_CODE=0
46
- for pattern in "${FILES[@]}"; do
47
- # Use find to expand patterns and handle missing files gracefully
48
- while IFS= read -r -d '' file; do
49
- if [[ -f "$file" ]]; then
50
- echo -e "${YELLOW}📄 Checking: $file${NC}"
51
- if ! vale "$file"; then
52
- EXIT_CODE=1
53
- fi
54
- fi
55
- done < <(find . -name "$pattern" -print0 2>/dev/null)
56
- done
57
-
58
- if [[ $EXIT_CODE -eq 0 ]]; then
59
- echo -e "${GREEN}✅ Vale linting completed successfully!${NC}"
60
- else
61
- echo -e "${RED}❌ Vale found issues. Please review and fix them.${NC}"
62
- fi
63
-
64
- exit $EXIT_CODE
@@ -1,175 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- # Run management utility for issuer CLI
5
- # Lists and manages cached runs in .issuer/logs/
6
-
7
- require 'bundler/setup'
8
- $LOAD_PATH.unshift(File.expand_path('../lib', __dir__))
9
- require 'issuer/cache'
10
-
11
- def show_help
12
- puts <<~HELP
13
- Issuer Run Management Utility
14
-
15
- Usage:
16
- ruby scripts/manage-runs.rb [command]
17
-
18
- Commands:
19
- list List all cached runs
20
- list --recent List recent runs only (last 10)
21
- show RUN_ID Show detailed information for a specific run
22
- clean-logs Remove all log files (use with caution)
23
-
24
- Examples:
25
- ruby scripts/manage-runs.rb list
26
- ruby scripts/manage-runs.rb show run_20250711_180124_97d1f1f3
27
- ruby scripts/manage-runs.rb list --recent
28
- HELP
29
- end
30
-
31
- def list_runs recent_only = false
32
- runs = Issuer::Cache.list_runs
33
- runs = runs.take(10) if recent_only
34
-
35
- if runs.empty?
36
- puts "No cached runs found."
37
- return
38
- end
39
-
40
- puts "Cached Runs#{recent_only ? ' (Recent)' : ''}:"
41
- puts "=" * 60
42
-
43
- runs.each do |run|
44
- puts "#{run[:run_id]} - #{run[:status].upcase}"
45
- puts " Started: #{run[:started_at]}"
46
-
47
- if run[:metadata] && run[:metadata][:issues_planned]
48
- puts " Issues planned: #{run[:metadata][:issues_planned]}"
49
- end
50
-
51
- if run[:status] == 'completed'
52
- puts " Completed: #{run[:completed_at]}"
53
- puts " Artifacts: #{run[:summary][:issues_created]} issues, #{run[:summary][:milestones_created]} milestones, #{run[:summary][:labels_created]} labels"
54
- puts " Processed: #{run[:summary][:issues_processed]} issues"
55
- elsif run[:status] == 'failed'
56
- puts " Failed: #{run[:failed_at] || 'unknown time'}"
57
- puts " Error: #{run[:error] || 'no error message'}"
58
- end
59
- puts ""
60
- end
61
-
62
- puts "Total: #{runs.length} runs"
63
- puts "Use 'ruby scripts/manage-runs.rb show RUN_ID' for detailed view"
64
- end
65
-
66
- def show_run run_id
67
- run_data = Issuer::Cache.get_run(run_id)
68
- unless run_data
69
- puts "Error: Run #{run_id} not found."
70
- return
71
- end
72
-
73
- puts "Run Details: #{run_id}"
74
- puts "=" * 60
75
- puts "Status: #{run_data[:status]}"
76
- puts "Started: #{run_data[:started_at]}"
77
-
78
- if run_data[:completed_at]
79
- puts "Completed: #{run_data[:completed_at]}"
80
- end
81
-
82
- if run_data[:failed_at]
83
- puts "Failed: #{run_data[:failed_at]}"
84
- puts "Error: #{run_data[:error]}" if run_data[:error]
85
- end
86
-
87
- if run_data[:metadata]
88
- puts ""
89
- puts "Metadata:"
90
- run_data[:metadata].each do |key, value|
91
- puts " #{key}: #{value}"
92
- end
93
- end
94
-
95
- if run_data[:artifacts]
96
- puts ""
97
- puts "Artifacts Created:"
98
-
99
- [:issues, :milestones, :labels].each do |type|
100
- artifacts = run_data[:artifacts][type.to_s] || run_data[:artifacts][type] || []
101
- next if artifacts.empty?
102
-
103
- puts " #{type.to_s.capitalize} (#{artifacts.length}):"
104
- artifacts.each do |artifact|
105
- case type
106
- when :issues
107
- puts " ##{artifact[:number] || artifact['number']} - #{artifact[:title] || artifact['title']}"
108
- puts " #{artifact[:url] || artifact['url']}"
109
- when :milestones
110
- puts " ##{artifact[:number] || artifact['number']} - #{artifact[:title] || artifact['title']}"
111
- puts " #{artifact[:url] || artifact['url']}"
112
- when :labels
113
- puts " #{artifact[:name] || artifact['name']} (#{artifact[:color] || artifact['color']})"
114
- puts " #{artifact[:url] || artifact['url']}"
115
- end
116
- puts ""
117
- end
118
- end
119
- end
120
-
121
- if run_data[:summary]
122
- puts "Summary:"
123
- run_data[:summary].each do |key, value|
124
- puts " #{key}: #{value}"
125
- end
126
- end
127
- end
128
-
129
- def clean_logs
130
- logs_dir = Issuer::Cache.logs_dir
131
- unless Dir.exist?(logs_dir)
132
- puts "No logs directory found."
133
- return
134
- end
135
-
136
- log_files = Dir.glob(File.join(logs_dir, '*.json'))
137
- if log_files.empty?
138
- puts "No log files found."
139
- return
140
- end
141
-
142
- puts "Found #{log_files.length} log files."
143
- print "Are you sure you want to delete all log files? [y/N]: "
144
- response = STDIN.gets.chomp.downcase
145
-
146
- unless ['y', 'yes'].include?(response)
147
- puts "Cancelled."
148
- return
149
- end
150
-
151
- log_files.each { |f| File.delete(f) }
152
- puts "Deleted #{log_files.length} log files."
153
- end
154
-
155
- # Main execution
156
- case ARGV[0]
157
- when 'list'
158
- recent_only = ARGV.include?('--recent')
159
- list_runs(recent_only)
160
- when 'show'
161
- if ARGV[1]
162
- show_run(ARGV[1])
163
- else
164
- puts "Error: Please specify a run ID"
165
- puts "Usage: ruby scripts/manage-runs.rb show RUN_ID"
166
- end
167
- when 'clean-logs'
168
- clean_logs
169
- when nil, '--help', '-h'
170
- show_help
171
- else
172
- puts "Error: Unknown command '#{ARGV[0]}'"
173
- puts ""
174
- show_help
175
- end
@@ -1,54 +0,0 @@
1
- #!/usr/bin/env bash
2
- # Pre-commit hook for Vale linting
3
-
4
- set -e
5
-
6
- echo "🔍 Running Vale pre-commit check..."
7
-
8
- # Check if Vale is installed
9
- if ! command -v vale &> /dev/null; then
10
- echo "âš ī¸ Vale not found. Skipping documentation linting."
11
- echo " Install Vale to enable documentation quality checks."
12
- exit 0
13
- fi
14
-
15
- # Get list of staged files that we care about (excluding copilot instructions)
16
- STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -E '\.(md|adoc|asciidoc)$' | grep -v '^\.github/copilot-instructions\.md$' || true)
17
-
18
- if [[ -z "$STAGED_FILES" ]]; then
19
- echo "â„šī¸ No documentation files staged for commit."
20
- exit 0
21
- fi
22
-
23
- echo "📄 Checking staged documentation files:"
24
- echo "$STAGED_FILES"
25
-
26
- # Run Vale on staged files
27
- TEMP_DIR=$(mktemp -d)
28
- EXIT_CODE=0
29
-
30
- for file in $STAGED_FILES; do
31
- if [[ -f "$file" ]]; then
32
- # Copy staged version to temp location
33
- git show :"$file" > "$TEMP_DIR/$(basename "$file")"
34
-
35
- echo "🔍 Linting: $file"
36
- if ! vale "$TEMP_DIR/$(basename "$file")"; then
37
- EXIT_CODE=1
38
- fi
39
- fi
40
- done
41
-
42
- # Cleanup
43
- rm -rf "$TEMP_DIR"
44
-
45
- if [[ $EXIT_CODE -ne 0 ]]; then
46
- echo ""
47
- echo "❌ Vale found documentation issues in staged files."
48
- echo " Please fix the issues above before committing."
49
- echo " Or use 'git commit --no-verify' to bypass this check."
50
- exit 1
51
- fi
52
-
53
- echo "✅ Documentation quality check passed!"
54
- exit 0
data/scripts/publish.sh DELETED
@@ -1,92 +0,0 @@
1
- #!/bin/bash
2
- # Manual publishing script for Ruby gem projects
3
-
4
- set -e
5
-
6
- # Parse command line arguments
7
- DRY_RUN=false
8
- while [[ $# -gt 0 ]]; do
9
- case $1 in
10
- --dry-run)
11
- DRY_RUN=true
12
- shift
13
- ;;
14
- *)
15
- echo "Unknown option: $1"
16
- echo "Usage: $0 [--dry-run]"
17
- exit 1
18
- ;;
19
- esac
20
- done
21
-
22
- # Load common build functions
23
- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
24
- source "$SCRIPT_DIR/lib/build-common.sh"
25
-
26
- # Project-specific configuration
27
- PROJECT_NAME="issuer"
28
- DOCKER_ORG="docopslab"
29
-
30
- echo -e "${GREEN}đŸ“Ļ ${PROJECT_NAME} Publishing Script${NC}"
31
- echo "=============================="
32
-
33
- # Check for required environment variables (skip in dry-run mode)
34
- if [ "$DRY_RUN" = false ]; then
35
- if [ -z "$RUBYGEMS_API_KEY" ]; then
36
- echo -e "${RED}❌ Error: RUBYGEMS_API_KEY environment variable not set${NC}"
37
- echo "Get your API key from https://rubygems.org/profile/edit"
38
- echo "Then run: export RUBYGEMS_API_KEY=your_key_here"
39
- exit 1
40
- fi
41
-
42
- if [ -z "$DOCKERHUB_USERNAME" ] || [ -z "$DOCKERHUB_TOKEN" ]; then
43
- echo -e "${RED}❌ Error: Docker Hub credentials not set${NC}"
44
- echo "Set DOCKERHUB_USERNAME and DOCKERHUB_TOKEN environment variables"
45
- exit 1
46
- fi
47
- fi
48
-
49
- # Get current version
50
- current_version=$(get_current_version)
51
- gem_file="pkg/${PROJECT_NAME}-$current_version.gem"
52
-
53
- # Check if gem file exists
54
- if [ ! -f "$gem_file" ]; then
55
- echo -e "${RED}❌ Error: Gem file $gem_file not found${NC}"
56
- echo "Run ./scripts/build.sh first"
57
- exit 1
58
- fi
59
-
60
- if [ "$DRY_RUN" = true ]; then
61
- echo -e "${YELLOW}🔍 Dry run mode enabled. The following actions would be performed:${NC}"
62
- echo "- Publish to RubyGems: gem push $gem_file"
63
- echo "- Login to Docker Hub and push Docker images"
64
- else
65
- # Publish to RubyGems
66
- echo -e "${YELLOW}💎 Publishing to RubyGems...${NC}"
67
- mkdir -p ~/.gem
68
- echo ":rubygems_api_key: $RUBYGEMS_API_KEY" > ~/.gem/credentials
69
- chmod 0600 ~/.gem/credentials
70
- gem push "$gem_file"
71
- echo -e "${GREEN}✅ Published to RubyGems successfully${NC}"
72
-
73
- # Login to Docker Hub
74
- echo -e "${YELLOW}đŸŗ Logging in to Docker Hub...${NC}"
75
- echo "$DOCKERHUB_TOKEN" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin
76
-
77
- # Push Docker images
78
- echo -e "${YELLOW}đŸŗ Pushing Docker images...${NC}"
79
- docker push ${DOCKER_ORG}/${PROJECT_NAME}:$current_version
80
- docker push ${DOCKER_ORG}/${PROJECT_NAME}:latest
81
- echo -e "${GREEN}✅ Pushed Docker images successfully${NC}"
82
- fi
83
-
84
- echo
85
- echo -e "${GREEN}🎉 Publishing completed successfully!${NC}"
86
- echo "=============================="
87
- echo -e "Gem: ${YELLOW}https://rubygems.org/gems/${PROJECT_NAME}/versions/$current_version${NC}"
88
- echo -e "Docker: ${YELLOW}https://hub.docker.com/r/${DOCKER_ORG}/${PROJECT_NAME}${NC}"
89
- echo
90
- echo "Verify installation:"
91
- echo " gem install ${PROJECT_NAME}"
92
- echo " docker pull ${DOCKER_ORG}/${PROJECT_NAME}:$current_version"
@@ -1,59 +0,0 @@
1
- #!/usr/bin/env bash
2
- # Vale setup script for new developers
3
- # This sets up Vale documentation linting for this project
4
-
5
- set -e
6
-
7
- echo "🔧 Setting up Vale for issuer project..."
8
-
9
- # Check if Vale is installed, install if needed
10
- if ! command -v vale &> /dev/null; then
11
- echo "đŸ“Ļ Installing Vale..."
12
-
13
- if command -v brew &> /dev/null; then
14
- echo " Using Homebrew..."
15
- brew install vale
16
- elif command -v wget &> /dev/null; then
17
- echo " Downloading Vale binary..."
18
- wget -O /tmp/vale.tar.gz https://github.com/errata-ai/vale/releases/download/v3.12.0/vale_3.12.0_Linux_64-bit.tar.gz
19
- cd /tmp && tar -xzf vale.tar.gz
20
- sudo mv vale /usr/local/bin/
21
- rm vale.tar.gz
22
- else
23
- echo "❌ Please install Vale manually:"
24
- echo " https://github.com/errata-ai/vale/releases"
25
- echo " Or install Homebrew/wget and run this script again"
26
- exit 1
27
- fi
28
-
29
- echo "✅ Vale installed successfully!"
30
- else
31
- echo "✅ Vale already installed ($(vale --version))"
32
- fi
33
-
34
- # Sync Vale style packages
35
- echo "🔄 Syncing Vale style packages..."
36
- vale sync
37
-
38
- # Install pre-commit hook if it doesn't exist
39
- HOOK_FILE=".git/hooks/pre-commit"
40
- if [[ ! -f "$HOOK_FILE" ]]; then
41
- echo "đŸĒ Installing pre-commit hook..."
42
- cp "scripts/pre-commit-template.sh" "$HOOK_FILE"
43
- chmod +x "$HOOK_FILE"
44
- echo "✅ Pre-commit hook installed!"
45
- else
46
- echo "â„šī¸ Pre-commit hook already exists"
47
- fi
48
-
49
- echo ""
50
- echo "🎉 Vale setup complete!"
51
- echo ""
52
- echo "📖 Available commands:"
53
- echo " vale README.adoc # Lint a specific file"
54
- echo " rake lint_docs # Lint all documentation"
55
- echo " rake lint_readme # Lint README only"
56
- echo " ./scripts/lint-docs.sh # Run comprehensive linting"
57
- echo ""
58
- echo "🔍 Pre-commit hook will automatically check documentation on commit"
59
- echo " Use 'git commit --no-verify' to skip if needed"