-
-
Notifications
You must be signed in to change notification settings - Fork 157
Re-design UI #749
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
timja
wants to merge
88
commits into
jenkinsci:master
Choose a base branch
from
timja:refine-ui
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Re-design UI #749
Changes from all commits
Commits
Show all changes
88 commits
Select commit
Hold shift + click to select a range
b3b6500
Init
timja 6685eb4
Fixes
timja 415f2b0
Minor change
timja a8779a8
Assign role button
timja f617db0
Manage roles page
timja ade6c21
Fix filtering
timja bbfc645
Tweaks
timja e075001
Revert "Tweaks"
timja 818302f
Tweak
timja 19eccfd
Filter
timja 253e255
Templates
timja 442056a
Macros
timja 9322026
Tweak
timja 187b330
More fixes
timja ddb2af3
Progress
timja d977a71
Getting there
timja 4648633
Validation
timja 7407fe4
Permission template not fully working but pushing up
timja 09a82d9
Move Macros button
janfaracik c0dd79a
Hide search bar when not needed
janfaracik 7008062
Update permission-templates.jelly
janfaracik b589628
Fix add button visibility
janfaracik df8d089
Update list-macros.jelly
janfaracik 735c3a7
Refine app bar
janfaracik e5c8ecd
Use CSS variable for .rsp-container margin
janfaracik dc0e703
Update role picking list
janfaracik 5413773
Remove ...
janfaracik ee23b7c
Refine filter button
janfaracik 17f9067
Improve filtering
timja 829b28e
Scaling
timja 9ecd0b6
Performance
timja 0cfa212
Add script for testing performance
timja 609f5bd
Group details and other fixes
timja 06b1232
Fix databinding
timja e59aa13
Don't resolve display names in main thread
timja 21019f2
Custom do check implementation to allow aborting so on filter its quick
timja d80b03b
Remove dead code
timja 4a0f3ab
Remove more dead code
timja c746584
If we don't queue like core does all requests get made pending
timja 92da911
Fix system read
timja 94f0461
Fixup system read
timja c2dca29
More system read fixes
timja 293e4fe
Refine
janfaracik 9dd01e2
Update index.jelly
janfaracik 00b5b71
Move Macros link
janfaracik f299e21
Use core styling for filter
janfaracik 2120cd6
Update group title appearance
janfaracik 9b531e1
Update search bar
janfaracik b8271d1
Use Jenkins search bars
janfaracik 9a3aa93
Use dropdown item class
janfaracik 4323c62
Fix search width
janfaracik 8435252
Edit roles dialog
timja b6344d7
Role assignments
timja efbbfc6
Improvements
timja 6014b6a
Implied permissions, fixup permission-templates
timja dbf2005
Permission-templates
timja 03af998
Side by side radio
timja 014a00c
Fix checkstyle
timja 334e6b7
Minor improvements
timja 030fd33
Prettier
timja a61b295
Minor fixups
timja 3a2cdbd
Cleanup code
timja 44d9b66
Make rbac role functional
timja 9c4dede
Fix tests
timja 7f771c7
Fixup UI for RBAC assigner role
timja 35f2347
Restore custom escape html
timja 29db509
Fix delete template
timja df85e4c
Copilot review fixes
timja b80e090
Copilot feedback
timja 6d17419
Remove old files
timja 9bf84b2
Simplify
timja e71e719
Fix test
timja ab1abcc
Apply suggestions from code review
timja e2d7d01
Restore JavaDoc
timja cfee4e6
Refactor add/edit to reuse same code
timja 28ebb56
Refactor do-add and do-edit
timja 58ad75e
Remove redundant suppressions and casts
timja 227ad19
Cleanup CSS
timja 315a179
Fix mistake
timja a7fd0a5
Improve performance of pagination
timja dd5d319
Update to released version
timja 6beea0a
Address review comments
timja 51e93b2
Tweak
timja 653511d
Fixups
timja 8d6ff19
Improve admin monitors
timja eb21bb5
Reword
timja eae6ea3
Reword
timja 3f5e43e
Remove unused files
timja File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,201 @@ | ||
| #!/bin/bash | ||
| # 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}" | ||
|
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 ===" | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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