Skip to content

Commit 2f8b1d7

Browse files
authored
Merge branch 'master' into docs-migrate-25-10-plugin-registry
2 parents 64a46ca + fec1d61 commit 2f8b1d7

File tree

285 files changed

+7677
-7432
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

285 files changed

+7677
-7432
lines changed

.github/workflows/seqeradocs-changelog.yml

Lines changed: 0 additions & 62 deletions
This file was deleted.

.specify/scripts/bash/check-prerequisites.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ EOF
7575
done
7676

7777
# Source common functions
78-
SCRIPT_DIR="$(CDPATH="" cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
78+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
7979
source "$SCRIPT_DIR/common.sh"
8080

8181
# Get feature paths and validate branch

.specify/scripts/bash/common.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ get_repo_root() {
77
git rev-parse --show-toplevel
88
else
99
# Fall back to script location for non-git repos
10-
local script_dir="$(CDPATH="" cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
10+
local script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
1111
(cd "$script_dir/../../.." && pwd)
1212
fi
1313
}
@@ -37,7 +37,7 @@ get_current_branch() {
3737
for dir in "$specs_dir"/*; do
3838
if [[ -d "$dir" ]]; then
3939
local dirname=$(basename "$dir")
40-
if [[ "$dirname" =~ ^([0-9]{3})- ]]; then
40+
if [[ "$dirname" =~ ^([0-9]{6})- ]]; then
4141
local number=${BASH_REMATCH[1]}
4242
number=$((10#$number))
4343
if [[ "$number" -gt "$highest" ]]; then
@@ -72,9 +72,10 @@ check_feature_branch() {
7272
return 0
7373
fi
7474

75-
if [[ ! "$branch" =~ ^[0-9]{3}- ]]; then
75+
# Accept date-based format (YYMMDD-feature)
76+
if [[ ! "$branch" =~ ^[0-9]{6}- ]]; then
7677
echo "ERROR: Not on a feature branch. Current branch: $branch" >&2
77-
echo "Feature branches should be named like: 001-feature-name" >&2
78+
echo "Feature branches should be named like: YYMMDD-feature-name (e.g., 251030-nextflow-modules)" >&2
7879
return 1
7980
fi
8081

@@ -84,14 +85,14 @@ check_feature_branch() {
8485
get_feature_dir() { echo "$1/specs/$2"; }
8586

8687
# Find feature directory by numeric prefix instead of exact branch match
87-
# This allows multiple branches to work on the same spec (e.g., 004-fix-bug, 004-add-feature)
88+
# This allows multiple branches to work on the same spec (e.g., 251030-fix-bug, 251030-add-feature)
8889
find_feature_dir_by_prefix() {
8990
local repo_root="$1"
9091
local branch_name="$2"
9192
local specs_dir="$repo_root/specs"
9293

93-
# Extract numeric prefix from branch (e.g., "004" from "004-whatever")
94-
if [[ ! "$branch_name" =~ ^([0-9]{3})- ]]; then
94+
# Extract numeric prefix from branch (e.g., "251030" from "251030-whatever")
95+
if [[ ! "$branch_name" =~ ^([0-9]{6})- ]]; then
9596
# If branch doesn't have numeric prefix, fall back to exact match
9697
echo "$specs_dir/$branch_name"
9798
return

.specify/scripts/bash/create-new-feature.sh

Lines changed: 15 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ set -e
44

55
JSON_MODE=false
66
SHORT_NAME=""
7-
BRANCH_NUMBER=""
87
ARGS=()
98
i=1
109
while [ $i -le $# ]; do
@@ -27,31 +26,22 @@ while [ $i -le $# ]; do
2726
fi
2827
SHORT_NAME="$next_arg"
2928
;;
30-
--number)
31-
if [ $((i + 1)) -gt $# ]; then
32-
echo 'Error: --number requires a value' >&2
33-
exit 1
34-
fi
35-
i=$((i + 1))
36-
next_arg="${!i}"
37-
if [[ "$next_arg" == --* ]]; then
38-
echo 'Error: --number requires a value' >&2
39-
exit 1
40-
fi
41-
BRANCH_NUMBER="$next_arg"
42-
;;
43-
--help|-h)
44-
echo "Usage: $0 [--json] [--short-name <name>] [--number N] <feature_description>"
29+
--help|-h)
30+
echo "Usage: $0 [--json] [--short-name <name>] <feature_description>"
4531
echo ""
4632
echo "Options:"
4733
echo " --json Output in JSON format"
4834
echo " --short-name <name> Provide a custom short name (2-4 words) for the branch"
49-
echo " --number N Specify branch number manually (overrides auto-detection)"
5035
echo " --help, -h Show this help message"
5136
echo ""
37+
echo "Branch naming: Uses YYMMDD-<feature-name> format (e.g., 251023-user-auth)"
38+
echo ""
5239
echo "Examples:"
5340
echo " $0 'Add user authentication system' --short-name 'user-auth'"
54-
echo " $0 'Implement OAuth2 integration for API' --number 5"
41+
echo " # Creates: 251023-user-auth (if run on Oct 23, 2025)"
42+
echo ""
43+
echo " $0 'Implement OAuth2 integration for API'"
44+
echo " # Creates: 251023-oauth2-integration-api"
5545
exit 0
5646
;;
5747
*)
@@ -63,7 +53,7 @@ done
6353

6454
FEATURE_DESCRIPTION="${ARGS[*]}"
6555
if [ -z "$FEATURE_DESCRIPTION" ]; then
66-
echo "Usage: $0 [--json] [--short-name <name>] [--number N] <feature_description>" >&2
56+
echo "Usage: $0 [--json] [--short-name <name>] <feature_description>" >&2
6757
exit 1
6858
fi
6959

@@ -80,94 +70,10 @@ find_repo_root() {
8070
return 1
8171
}
8272

83-
# Function to get highest number from specs directory
84-
get_highest_from_specs() {
85-
local specs_dir="$1"
86-
local highest=0
87-
88-
if [ -d "$specs_dir" ]; then
89-
for dir in "$specs_dir"/*; do
90-
[ -d "$dir" ] || continue
91-
dirname=$(basename "$dir")
92-
number=$(echo "$dirname" | grep -o '^[0-9]\+' || echo "0")
93-
number=$((10#$number))
94-
if [ "$number" -gt "$highest" ]; then
95-
highest=$number
96-
fi
97-
done
98-
fi
99-
100-
echo "$highest"
101-
}
102-
103-
# Function to get highest number from git branches
104-
get_highest_from_branches() {
105-
local highest=0
106-
107-
# Get all branches (local and remote)
108-
branches=$(git branch -a 2>/dev/null || echo "")
109-
110-
if [ -n "$branches" ]; then
111-
while IFS= read -r branch; do
112-
# Clean branch name: remove leading markers and remote prefixes
113-
clean_branch=$(echo "$branch" | sed 's/^[* ]*//; s|^remotes/[^/]*/||')
114-
115-
# Extract feature number if branch matches pattern ###-*
116-
if echo "$clean_branch" | grep -q '^[0-9]\{3\}-'; then
117-
number=$(echo "$clean_branch" | grep -o '^[0-9]\{3\}' || echo "0")
118-
number=$((10#$number))
119-
if [ "$number" -gt "$highest" ]; then
120-
highest=$number
121-
fi
122-
fi
123-
done <<< "$branches"
124-
fi
125-
126-
echo "$highest"
127-
}
128-
129-
# Function to check existing branches (local and remote) and return next available number
130-
check_existing_branches() {
131-
local short_name="$1"
132-
local specs_dir="$2"
133-
134-
# Fetch all remotes to get latest branch info (suppress errors if no remotes)
135-
git fetch --all --prune 2>/dev/null || true
136-
137-
# Find all branches matching the pattern using git ls-remote (more reliable)
138-
local remote_branches=$(git ls-remote --heads origin 2>/dev/null | grep -E "refs/heads/[0-9]+-${short_name}$" | sed 's/.*\/\([0-9]*\)-.*/\1/' | sort -n)
139-
140-
# Also check local branches
141-
local local_branches=$(git branch 2>/dev/null | grep -E "^[* ]*[0-9]+-${short_name}$" | sed 's/^[* ]*//' | sed 's/-.*//' | sort -n)
142-
143-
# Check specs directory as well
144-
local spec_dirs=""
145-
if [ -d "$specs_dir" ]; then
146-
spec_dirs=$(find "$specs_dir" -maxdepth 1 -type d -name "[0-9]*-${short_name}" 2>/dev/null | xargs -n1 basename 2>/dev/null | sed 's/-.*//' | sort -n)
147-
fi
148-
149-
# Combine all sources and get the highest number
150-
local max_num=0
151-
for num in $remote_branches $local_branches $spec_dirs; do
152-
if [ "$num" -gt "$max_num" ]; then
153-
max_num=$num
154-
fi
155-
done
156-
157-
# Return next number
158-
echo $((max_num + 1))
159-
}
160-
161-
# Function to clean and format a branch name
162-
clean_branch_name() {
163-
local name="$1"
164-
echo "$name" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | sed 's/-\+/-/g' | sed 's/^-//' | sed 's/-$//'
165-
}
166-
16773
# Resolve repository root. Prefer git information when available, but fall back
16874
# to searching for repository markers so the workflow still functions in repositories that
16975
# were initialised with --no-git.
170-
SCRIPT_DIR="$(CDPATH="" cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
76+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
17177

17278
if git rev-parse --show-toplevel >/dev/null 2>&1; then
17379
REPO_ROOT=$(git rev-parse --show-toplevel)
@@ -186,6 +92,9 @@ cd "$REPO_ROOT"
18692
SPECS_DIR="$REPO_ROOT/specs"
18793
mkdir -p "$SPECS_DIR"
18894

95+
# Use YYMMDD format for feature numbering (date-based prefix)
96+
FEATURE_NUM=$(date +%y%m%d)
97+
18998
# Function to generate branch name with stop word filtering and length filtering
19099
generate_branch_name() {
191100
local description="$1"
@@ -229,33 +138,19 @@ generate_branch_name() {
229138
echo "$result"
230139
else
231140
# Fallback to original logic if no meaningful words found
232-
local cleaned=$(clean_branch_name "$description")
233-
echo "$cleaned" | tr '-' '\n' | grep -v '^$' | head -3 | tr '\n' '-' | sed 's/-$//'
141+
echo "$description" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | sed 's/-\+/-/g' | sed 's/^-//' | sed 's/-$//' | tr '-' '\n' | grep -v '^$' | head -3 | tr '\n' '-' | sed 's/-$//'
234142
fi
235143
}
236144

237145
# Generate branch name
238146
if [ -n "$SHORT_NAME" ]; then
239147
# Use provided short name, just clean it up
240-
BRANCH_SUFFIX=$(clean_branch_name "$SHORT_NAME")
148+
BRANCH_SUFFIX=$(echo "$SHORT_NAME" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | sed 's/-\+/-/g' | sed 's/^-//' | sed 's/-$//')
241149
else
242150
# Generate from description with smart filtering
243151
BRANCH_SUFFIX=$(generate_branch_name "$FEATURE_DESCRIPTION")
244152
fi
245153

246-
# Determine branch number
247-
if [ -z "$BRANCH_NUMBER" ]; then
248-
if [ "$HAS_GIT" = true ]; then
249-
# Check existing branches on remotes
250-
BRANCH_NUMBER=$(check_existing_branches "$BRANCH_SUFFIX" "$SPECS_DIR")
251-
else
252-
# Fall back to local directory check
253-
HIGHEST=$(get_highest_from_specs "$SPECS_DIR")
254-
BRANCH_NUMBER=$((HIGHEST + 1))
255-
fi
256-
fi
257-
258-
FEATURE_NUM=$(printf "%03d" "$BRANCH_NUMBER")
259154
BRANCH_NAME="${FEATURE_NUM}-${BRANCH_SUFFIX}"
260155

261156
# GitHub enforces a 244-byte limit on branch names

.specify/scripts/bash/setup-plan.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ for arg in "$@"; do
2424
done
2525

2626
# Get script directory and load common functions
27-
SCRIPT_DIR="$(CDPATH="" cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
27+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
2828
source "$SCRIPT_DIR/common.sh"
2929

3030
# Get all paths and variables from common functions

0 commit comments

Comments
 (0)