Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
b3b6500
Init
timja Apr 3, 2026
6685eb4
Fixes
timja Apr 4, 2026
415f2b0
Minor change
timja Apr 4, 2026
a8779a8
Assign role button
timja Apr 4, 2026
f617db0
Manage roles page
timja Apr 4, 2026
ade6c21
Fix filtering
timja Apr 4, 2026
bbfc645
Tweaks
timja Apr 4, 2026
e075001
Revert "Tweaks"
timja Apr 4, 2026
818302f
Tweak
timja Apr 4, 2026
19eccfd
Filter
timja Apr 4, 2026
253e255
Templates
timja Apr 4, 2026
442056a
Macros
timja Apr 4, 2026
9322026
Tweak
timja Apr 4, 2026
187b330
More fixes
timja Apr 4, 2026
ddb2af3
Progress
timja Apr 4, 2026
d977a71
Getting there
timja Apr 4, 2026
4648633
Validation
timja Apr 5, 2026
7407fe4
Permission template not fully working but pushing up
timja Apr 5, 2026
09a82d9
Move Macros button
janfaracik Apr 5, 2026
c0dd79a
Hide search bar when not needed
janfaracik Apr 5, 2026
7008062
Update permission-templates.jelly
janfaracik Apr 5, 2026
b589628
Fix add button visibility
janfaracik Apr 5, 2026
df8d089
Update list-macros.jelly
janfaracik Apr 5, 2026
735c3a7
Refine app bar
janfaracik Apr 5, 2026
e5c8ecd
Use CSS variable for .rsp-container margin
janfaracik Apr 5, 2026
dc0e703
Update role picking list
janfaracik Apr 5, 2026
5413773
Remove ...
janfaracik Apr 5, 2026
ee23b7c
Refine filter button
janfaracik Apr 5, 2026
17f9067
Improve filtering
timja Apr 5, 2026
829b28e
Scaling
timja Apr 5, 2026
9ecd0b6
Performance
timja Apr 5, 2026
0cfa212
Add script for testing performance
timja Apr 5, 2026
609f5bd
Group details and other fixes
timja Apr 5, 2026
06b1232
Fix databinding
timja Apr 5, 2026
e59aa13
Don't resolve display names in main thread
timja Apr 6, 2026
21019f2
Custom do check implementation to allow aborting so on filter its quick
timja Apr 6, 2026
d80b03b
Remove dead code
timja Apr 6, 2026
4a0f3ab
Remove more dead code
timja Apr 6, 2026
c746584
If we don't queue like core does all requests get made pending
timja Apr 6, 2026
92da911
Fix system read
timja Apr 6, 2026
94f0461
Fixup system read
timja Apr 6, 2026
c2dca29
More system read fixes
timja Apr 6, 2026
293e4fe
Refine
janfaracik Apr 7, 2026
9dd01e2
Update index.jelly
janfaracik Apr 7, 2026
00b5b71
Move Macros link
janfaracik Apr 7, 2026
f299e21
Use core styling for filter
janfaracik Apr 7, 2026
2120cd6
Update group title appearance
janfaracik Apr 7, 2026
9b531e1
Update search bar
janfaracik Apr 7, 2026
b8271d1
Use Jenkins search bars
janfaracik Apr 7, 2026
9a3aa93
Use dropdown item class
janfaracik Apr 7, 2026
4323c62
Fix search width
janfaracik Apr 7, 2026
8435252
Edit roles dialog
timja Apr 10, 2026
b6344d7
Role assignments
timja Apr 11, 2026
efbbfc6
Improvements
timja Apr 11, 2026
6014b6a
Implied permissions, fixup permission-templates
timja Apr 11, 2026
dbf2005
Permission-templates
timja Apr 11, 2026
03af998
Side by side radio
timja Apr 11, 2026
014a00c
Fix checkstyle
timja Apr 11, 2026
334e6b7
Minor improvements
timja Apr 11, 2026
030fd33
Prettier
timja Apr 11, 2026
a61b295
Minor fixups
timja Apr 11, 2026
3a2cdbd
Cleanup code
timja Apr 11, 2026
44d9b66
Make rbac role functional
timja Apr 11, 2026
9c4dede
Fix tests
timja Apr 11, 2026
7f771c7
Fixup UI for RBAC assigner role
timja Apr 11, 2026
35f2347
Restore custom escape html
timja Apr 11, 2026
29db509
Fix delete template
timja Apr 11, 2026
df85e4c
Copilot review fixes
timja Apr 11, 2026
b80e090
Copilot feedback
timja Apr 11, 2026
6d17419
Remove old files
timja Apr 11, 2026
9bf84b2
Simplify
timja Apr 11, 2026
e71e719
Fix test
timja Apr 11, 2026
ab1abcc
Apply suggestions from code review
timja Apr 17, 2026
e2d7d01
Restore JavaDoc
timja Apr 17, 2026
cfee4e6
Refactor add/edit to reuse same code
timja Apr 17, 2026
28ebb56
Refactor do-add and do-edit
timja Apr 17, 2026
58ad75e
Remove redundant suppressions and casts
timja Apr 17, 2026
227ad19
Cleanup CSS
timja Apr 17, 2026
315a179
Fix mistake
timja Apr 17, 2026
a7fd0a5
Improve performance of pagination
timja Apr 17, 2026
dd5d319
Update to released version
timja Apr 21, 2026
6beea0a
Address review comments
timja May 17, 2026
51e93b2
Tweak
timja May 17, 2026
653511d
Fixups
timja May 17, 2026
8d6ff19
Improve admin monitors
timja May 17, 2026
eb21bb5
Reword
timja May 17, 2026
eae6ea3
Reword
timja May 17, 2026
3f5e43e
Remove unused files
timja May 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@

<properties>
<changelist>999999-SNAPSHOT</changelist>
<jenkins.baseline>2.479</jenkins.baseline>
<jenkins.version>${jenkins.baseline}.3</jenkins.version>
<jenkins.baseline>2.555</jenkins.baseline>
<jenkins.version>2.560</jenkins.version>
<gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>
<checkstyle.version>13.0.0</checkstyle.version>
<hpi.compatibleSinceVersion>640</hpi.compatibleSinceVersion>
Expand All @@ -45,7 +45,7 @@
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-${jenkins.baseline}.x</artifactId>
<version>5054.v620b_5d2b_d5e6</version>
<version>6421.v4a_efb_4b_3a_61d</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
201 changes: 201 additions & 0 deletions seed-data.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
#!/bin/bash

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Useful script for performance testing

# Seed script: creates ~500 roles, ~150 agent roles, 2500 user assignments, 250 groups
# Usage: ./seed-data.sh [JENKINS_URL]
set -euo pipefail

JENKINS="${1:-http://localhost:8080/jenkins}"
API="$JENKINS/role-strategy/strategy"
JENKINS_USER="${JENKINS_USERNAME}"
JENKINS_TOKEN="${JENKINS_API_TOKEN}"
Comment thread
timja marked this conversation as resolved.

echo "=== Seeding role-strategy data at $JENKINS ==="
echo "Authenticating as $JENKINS_USER..."
curl -sf -u "$JENKINS_USER:$JENKINS_TOKEN" "$JENKINS/api/json" > /dev/null || { echo "ERROR: Cannot reach Jenkins"; exit 1; }
Comment on lines +2 to +13
echo " Connected OK"

api_post() {
local url="$1"
local http_code
http_code=$(curl -s -o /dev/null -w "%{http_code}" -X POST -u "$JENKINS_USER:$JENKINS_TOKEN" "$url") || true
[ "$http_code" = "200" ]
}

OK=0; FAIL=0

# --- Global Roles (100) ---
echo ""
echo "Creating 100 global roles..."

GLOBAL_PERMS=(
"hudson.model.Hudson.Administer"
"hudson.model.Hudson.Read"
"hudson.model.Hudson.Manage,hudson.model.Hudson.Read"
"hudson.model.Hudson.Read"
"hudson.model.Hudson.Read,hudson.model.Hudson.Manage"
)
GLOBAL_PREFIXES=("super" "senior" "junior" "lead" "staff" "principal" "associate" "chief" "deputy" "acting" "interim" "temp" "contract" "remote" "onsite" "global" "regional" "local" "external" "internal")
GLOBAL_SUFFIXES=("admin" "reader" "operator" "monitor" "engineer" "analyst" "architect" "manager" "coordinator" "specialist" "consultant" "advisor" "officer" "director" "supervisor" "technician" "developer" "tester" "auditor" "reviewer")

for i in $(seq 0 99); do
pi=$((i / 20))
si=$((i % 20))
name="${GLOBAL_PREFIXES[$pi]}-${GLOBAL_SUFFIXES[$si]}"
perms="${GLOBAL_PERMS[$((i % ${#GLOBAL_PERMS[@]}))]}"
if api_post "$API/addRole?type=globalRoles&roleName=$name&permissionIds=$perms&overwrite=false"; then
((OK++))
else
((FAIL++))
fi
done
echo " Global roles: $OK ok, $FAIL fail"

# --- Item Roles (250) ---
echo ""
echo "Creating 250 item roles..."
S0=$OK; F0=$FAIL

ITEM_PERMS=(
"hudson.model.Item.Read,hudson.model.Item.Build"
"hudson.model.Item.Read,hudson.model.Item.Build,hudson.model.Item.Configure"
"hudson.model.Item.Read,hudson.model.Item.Build,hudson.model.Item.Configure,hudson.model.Item.Workspace"
"hudson.model.Item.Read,hudson.model.Item.Build,hudson.model.Item.Configure,hudson.model.Item.Create"
"hudson.model.Item.Read,hudson.model.Item.Build,hudson.model.Item.Configure,hudson.model.Item.Create,hudson.model.Item.Delete"
"hudson.model.Item.Read"
"hudson.model.Item.Read,hudson.model.Item.Discover"
"hudson.model.Item.Read,hudson.model.Item.Build,hudson.model.Item.Cancel"
"hudson.model.Item.Read,hudson.model.Item.Build,hudson.model.Item.Configure,hudson.model.Item.Move"
"hudson.model.Item.Read,hudson.model.Item.Build,hudson.model.Item.Workspace,hudson.model.Run.Update"
)
ITEM_PREFIXES=("frontend" "backend" "mobile" "data" "infra" "devops" "platform" "cloud" "security" "analytics" "ml" "api" "web" "desktop" "embedded" "iot" "blockchain" "ai" "microservice" "monolith" "gateway" "proxy" "cache" "queue" "stream" "batch" "realtime" "legacy" "modern" "hybrid" "serverless" "container" "native" "cross-platform" "enterprise" "startup" "fintech" "healthtech" "edtech" "gamedev" "media" "social" "commerce" "payments" "identity" "messaging" "storage" "compute" "network" "database")
ITEM_SUFFIXES=("dev" "staging" "prod" "test" "qa" "uat" "demo" "sandbox" "preview" "canary" "blue" "green" "alpha" "beta" "rc" "stable" "nightly" "weekly" "release" "hotfix" "feature" "bugfix" "spike" "poc" "mvp" "v1" "v2" "v3" "next" "current" "archive" "backup" "mirror" "primary" "secondary" "failover" "dr" "perf" "load" "stress" "smoke" "regression" "integration" "e2e" "unit" "contract" "security-scan" "lint" "build" "deploy")

for i in $(seq 0 249); do
pi=$((i % ${#ITEM_PREFIXES[@]}))
si=$((i / ${#ITEM_PREFIXES[@]} % ${#ITEM_SUFFIXES[@]}))
name="${ITEM_PREFIXES[$pi]}-${ITEM_SUFFIXES[$si]}"
pattern="${ITEM_PREFIXES[$pi]}-${ITEM_SUFFIXES[$si]}-.*"
perms="${ITEM_PERMS[$((i % ${#ITEM_PERMS[@]}))]}"
if api_post "$API/addRole?type=projectRoles&roleName=$name&permissionIds=$perms&overwrite=false&pattern=$pattern"; then
((OK++))
else
((FAIL++))
fi
done
echo " Item roles: $((OK-S0)) ok, $((FAIL-F0)) fail"

# --- Agent Roles (150) ---
echo ""
echo "Creating 150 agent roles..."
S0=$OK; F0=$FAIL

AGENT_PREFIXES=("linux" "windows" "macos" "docker" "k8s" "gpu" "arm" "x86" "spot" "onprem" "cloud" "aws" "gcp" "azure" "metal" "vm" "lxc" "podman" "nerdctl" "containerd" "crio" "fargate" "ecs" "eks" "aks" "gke" "openshift" "rancher" "nomad" "mesos")
AGENT_SUFFIXES=("builder" "runner" "executor" "worker" "node" "agent" "slave" "host" "instance" "pod" "container" "machine" "server" "cluster" "pool" "fleet" "farm" "grid" "swarm" "herd" "pack" "squad" "brigade" "team" "unit" "cell" "zone" "region" "rack" "bay")

for i in $(seq 0 149); do
pi=$((i % ${#AGENT_PREFIXES[@]}))
si=$((i / ${#AGENT_PREFIXES[@]} % ${#AGENT_SUFFIXES[@]}))
name="${AGENT_PREFIXES[$pi]}-${AGENT_SUFFIXES[$si]}"
pattern="${AGENT_PREFIXES[$pi]}-${AGENT_SUFFIXES[$si]}-.*"
if api_post "$API/addRole?type=slaveRoles&roleName=$name&permissionIds=hudson.model.Computer.Build,hudson.model.Computer.Connect&overwrite=false&pattern=$pattern"; then
((OK++))
else
((FAIL++))
fi
done
echo " Agent roles: $((OK-S0)) ok, $((FAIL-F0)) fail"

# --- Collect role names for assignment ---
GLOBAL_ROLE_NAMES=()
for i in $(seq 0 99); do
pi=$((i / 20)); si=$((i % 20))
GLOBAL_ROLE_NAMES+=("${GLOBAL_PREFIXES[$pi]}-${GLOBAL_SUFFIXES[$si]}")
done
ITEM_ROLE_NAMES=()
for i in $(seq 0 249); do
pi=$((i % ${#ITEM_PREFIXES[@]})); si=$((i / ${#ITEM_PREFIXES[@]} % ${#ITEM_SUFFIXES[@]}))
ITEM_ROLE_NAMES+=("${ITEM_PREFIXES[$pi]}-${ITEM_SUFFIXES[$si]}")
done
AGENT_ROLE_NAMES=()
for i in $(seq 0 149); do
pi=$((i % ${#AGENT_PREFIXES[@]})); si=$((i / ${#AGENT_PREFIXES[@]} % ${#AGENT_SUFFIXES[@]}))
AGENT_ROLE_NAMES+=("${AGENT_PREFIXES[$pi]}-${AGENT_SUFFIXES[$si]}")
done

NUM_GLOBAL=${#GLOBAL_ROLE_NAMES[@]}
NUM_ITEM=${#ITEM_ROLE_NAMES[@]}
NUM_AGENT=${#AGENT_ROLE_NAMES[@]}

# --- User Assignments (2500) ---
echo ""
echo "Assigning 2500 users..."
S0=$OK; F0=$FAIL

FIRST=("James" "Mary" "Robert" "Patricia" "John" "Jennifer" "Michael" "Linda" "David" "Elizabeth" "William" "Barbara" "Richard" "Susan" "Joseph" "Jessica" "Thomas" "Sarah" "Chris" "Karen" "Charles" "Lisa" "Daniel" "Nancy" "Matt" "Betty" "Tony" "Maggie" "Mark" "Sandra" "Don" "Ashley" "Steve" "Dorothy" "Paul" "Kim" "Andrew" "Emily" "Josh" "Donna" "Ken" "Michelle" "Kevin" "Carol" "Brian" "Amanda" "George" "Melissa" "Tim" "Deborah" "Ron" "Steph" "Ed" "Rebecca" "Jason" "Sharon" "Jeff" "Laura" "Ryan" "Cynthia" "Jake" "Kate" "Gary" "Amy" "Nick" "Angela" "Eric" "Shirley" "Jon" "Anna" "Larry" "Pam" "Justin" "Emma" "Scott" "Nicole" "Brandon" "Helen" "Ben" "Sam" "Ray" "Christine" "Greg" "Debra" "Frank" "Rachel" "Alex" "Carolyn" "Pat" "Janet" "Jack" "Cath" "Dennis" "Maria" "Jerry" "Heather" "Tyler" "Diane" "Liam" "Olivia")
LAST=("Smith" "Johnson" "Williams" "Brown" "Jones" "Garcia" "Miller" "Davis" "Rodriguez" "Martinez" "Hernandez" "Lopez" "Gonzalez" "Wilson" "Anderson" "Thomas" "Taylor" "Moore" "Jackson" "Martin" "Lee" "Perez" "Thompson" "White" "Harris" "Sanchez" "Clark" "Ramirez" "Lewis" "Robinson" "Walker" "Young" "Allen" "King" "Wright" "Scott" "Torres" "Nguyen" "Hill" "Flores" "Green" "Adams" "Nelson" "Baker" "Hall" "Rivera" "Campbell" "Mitchell" "Carter" "Roberts" "Chen" "Wu" "Li" "Wang" "Zhang" "Liu" "Yang" "Huang" "Zhao" "Zhou" "Kumar" "Singh" "Patel" "Sharma" "Gupta" "Joshi" "Shah" "Mehta" "Rao" "Das" "Muller" "Schmidt" "Fischer" "Weber" "Meyer" "Becker" "Schulz" "Hoffmann" "Koch" "Richter" "Wolf" "Braun" "Durand" "Bernard" "Petit" "Robert" "Moreau" "Simon" "Laurent" "Michel" "Lefebvre" "Rossi" "Russo" "Ferrari" "Esposito" "Bianchi" "Romano" "Colombo" "Ricci" "Marino" "Greco")

NF=${#FIRST[@]}; NL=${#LAST[@]}

for i in $(seq 1 2500); do
fi_idx=$(( (i - 1) % NF ))
li_idx=$(( (i - 1) / NF % NL ))
username=$(echo "${FIRST[$fi_idx]:0:1}${LAST[$li_idx]}${i}" | tr '[:upper:]' '[:lower:]')

gi=$(( i % NUM_GLOBAL ))
api_post "$API/assignUserRole?type=globalRoles&roleName=${GLOBAL_ROLE_NAMES[$gi]}&user=$username" || true

if [ $(( i % 10 )) -lt 7 ]; then
ii=$(( i % NUM_ITEM ))
api_post "$API/assignUserRole?type=projectRoles&roleName=${ITEM_ROLE_NAMES[$ii]}&user=$username" || true
fi

if [ $(( i % 10 )) -lt 3 ]; then
ai=$(( i % NUM_AGENT ))
api_post "$API/assignUserRole?type=slaveRoles&roleName=${AGENT_ROLE_NAMES[$ai]}&user=$username" || true
fi

if [ $(( i % 500 )) -eq 0 ]; then
echo " $i/2500 users..."
fi
done
echo " Users done"

# --- Group Assignments (250) ---
echo ""
echo "Assigning 250 groups..."

DEPT=("engineering" "frontend" "backend" "devops" "qa" "security" "data" "mobile" "platform" "infra" "sre" "design" "product" "management" "hr" "finance" "legal" "marketing" "sales" "support" "research" "ml" "analytics" "compliance" "architecture")
LEVEL=("team" "squad" "guild" "chapter" "tribe" "division" "department" "unit" "group" "org")

for i in $(seq 0 249); do
di=$(( i % ${#DEPT[@]} ))
li=$(( i / ${#DEPT[@]} % ${#LEVEL[@]} ))
group="${DEPT[$di]}-${LEVEL[$li]}"

gi=$(( i % NUM_GLOBAL ))
api_post "$API/assignGroupRole?type=globalRoles&roleName=${GLOBAL_ROLE_NAMES[$gi]}&group=$group" || true

if [ $(( i % 3 )) -eq 0 ]; then
ii=$(( i % NUM_ITEM ))
api_post "$API/assignGroupRole?type=projectRoles&roleName=${ITEM_ROLE_NAMES[$ii]}&group=$group" || true
fi

if [ $(( i % 50 )) -eq 0 ]; then
echo " $((i+1))/250 groups..."
fi
done
echo " Groups done"

# --- Verify ---
echo ""
echo "=== Verifying ==="
GLOBAL_COUNT=$(curl -sf -u "$JENKINS_USER:$JENKINS_TOKEN" "$API/getAllRoles?type=globalRoles" | python3 -c "import json,sys; print(len(json.load(sys.stdin)))" 2>/dev/null || echo "?")
ITEM_COUNT=$(curl -sf -u "$JENKINS_USER:$JENKINS_TOKEN" "$API/getAllRoles?type=projectRoles" | python3 -c "import json,sys; print(len(json.load(sys.stdin)))" 2>/dev/null || echo "?")
AGENT_COUNT=$(curl -sf -u "$JENKINS_USER:$JENKINS_TOKEN" "$API/getAllRoles?type=slaveRoles" | python3 -c "import json,sys; print(len(json.load(sys.stdin)))" 2>/dev/null || echo "?")
GLOBAL_USERS=$(curl -sf -u "$JENKINS_USER:$JENKINS_TOKEN" "$API/getRoleAssignments?type=globalRoles" | python3 -c "import json,sys; print(len(json.load(sys.stdin)))" 2>/dev/null || echo "?")

echo " Global roles: $GLOBAL_COUNT"
echo " Item roles: $ITEM_COUNT"
echo " Agent roles: $AGENT_COUNT"
echo " Global role assignments: $GLOBAL_USERS"
echo ""
echo "=== Done ==="
Loading
Loading