fix: remove deprecated workflows, pin SHAs, fix autoload bugs, add CI governance#348
Open
ss-o wants to merge 22 commits into
Open
fix: remove deprecated workflows, pin SHAs, fix autoload bugs, add CI governance#348ss-o wants to merge 22 commits into
ss-o wants to merge 22 commits into
Conversation
Signed-off-by: Salvydas Lukosius <ss-o@users.noreply.github.com>
Signed-off-by: Salvydas Lukosius <ss-o@users.noreply.github.com>
- Add .github/copilot-instructions.md with commit format rules, branch model documentation, and prohibition on AI co-author trailers or AI config files (AGENTS.md, CLAUDE.md, GEMINI.md, .cursorrules…) - Add .github/workflows/commit-lint.yml: PR workflow that validates conventional commit subject format, blocks AI co-author trailers, checks PR title format, and enforces branch naming convention - Update .github/workflows/trunk-check.yml: run Trunk on next branch in addition to main to catch issues before integration - Update .github/PULL_REQUEST_TEMPLATE.md: document the branch model (branch from next, PR to next, next→main for releases) and add checklist items for commit hygiene - Update docs/CONTRIBUTING.md: full branch model diagram, commit message guide, and explicit list of files not to add to the repo - Update .gitignore: add AI assistant config file patterns
Removes five workflows no longer needed: - rebase.yml: autorebase bot (superseded by merge queues) - stale.yml: automated stale-issue closer (policy changed) - pr-labels.yml: label verification bot (replaced by labeler.yml) - lock.yml: issue/PR locking bot (no longer used) - zunit.yml: Docker-based test workflow (superseded by zd-integration.yml)
- autoload.zsh: use loop variable rm_file (was rm_compiled) in zi-auto-reload - autoload.zsh: drop --autostash from git merge (not a valid option) - autoload.zsh: capture pipestatus[1] from make|tee; drop redundant second make - autoload.zsh: make cp explicit (zpmod.so → zpmod.bundle, no brace expansion) - autoload.zsh: guard --reset recompile message with RECOMPILE_REQUEST existence - docs/README.md: fix thref → href on VIM badge; fix </p></a> → </a></p> - zi.zsh: remove duplicate 'version' entry from ZI[cmd-list] - zi.zsh: fix spelling 'noticable' → 'noticeable' and grammar in zicompinit_fast comment
Replace the single wildcard rule with a tiered ownership model: - Default catch-all: @ss-o for day-to-day reviews - Core Zsh runtime (zi.zsh, lib/): @z-shell/tsc sign-off required - CI/workflows and docs: @ss-o only — no TSC overhead - CODEOWNERS itself: @z-shell/tsc to prevent unauthorized rewrites Rules are ordered broadest-to-most-specific so the last matching rule wins, following GitHub's documented evaluation semantics.
There was a problem hiding this comment.
Pull request overview
This PR modernizes the repository’s CI/governance setup (removing deprecated workflows, pinning action SHAs, adding concurrency/CodeQL/commit linting) while also refactoring several Zi runtime Zsh paths around self-update, module handling, and completion initialization.
Changes:
- CI: remove deprecated workflows, add CodeQL + commit-lint, pin
actions/checkoutby SHA, addconcurrencyand adjust branch triggers. - Runtime: update
zi.zsh/lib/zsh/*for version reporting, module management, self-update + auto-reload, and completion handling. - Governance/docs: update CODEOWNERS, add PR template + Copilot instructions, refresh README/CONTRIBUTING, expand
.gitignore.
Reviewed changes
Copilot reviewed 25 out of 26 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
zi.zsh |
Adds version command, refactors option parsing/messages, introduces .zi-set-mtime, changes compinit/module flows. |
lib/zsh/side.zsh |
Minor fixes (builtin autoload, spelling) and removes old .zi-check-module. |
lib/zsh/rpm2cpio.zsh |
Tightens variable scoping (local sigsize). |
lib/zsh/install.zsh |
Refactors completion install + compinit frontend; adds rehash in more places. |
lib/zsh/git-process-output.zsh |
Adds configurable color and adjusts progress rendering/nearcolor loading. |
lib/zsh/autoload.zsh |
Adds auto-reload + revamped self-update; updates completion uninstall, update messaging, module build/reset/info. |
lib/_zi |
Updates completion script options and adds version command completion. |
docs/README.md |
Substantial HTML formatting changes, new logo asset usage, updated badges/links layout. |
docs/CONTRIBUTING.md |
Rewrites contribution guidelines (branch model + Conventional Commits). |
.gitignore |
Adds ignores for AI-assistant config files; keeps trunk output ignore. |
.github/workflows/zunit.yml |
Removed workflow. |
.github/workflows/zsh-n.yml |
Adds concurrency/permissions and pins actions/checkout SHA. |
.github/workflows/zd-integration.yml |
Adds reusable workflow-based integration testing against z-shell/zd. |
.github/workflows/trunk-check.yml |
Runs on main and next, pins actions/checkout SHA. |
.github/workflows/stale.yml |
Removed workflow. |
.github/workflows/rebase.yml |
Removed workflow. |
.github/workflows/pr-labels.yml |
Removed workflow. |
.github/workflows/lock.yml |
Removed workflow. |
.github/workflows/labeler.yml |
Removed workflow. |
.github/workflows/commit-lint.yml |
Adds Conventional Commits validation for commits, PR title, and branch naming. |
.github/workflows/codeql.yml |
Adds SHA-pinned CodeQL v4 scanning for GitHub Actions. |
.github/PULL_REQUEST_TEMPLATE.md |
Replaces template with branch/commit checklist aligned to next workflow. |
.github/labeler.yml |
Removes labeler configuration (workflow removed). |
.github/dependabot.yml |
Switches to weekly updates and targets next. |
.github/copilot-instructions.md |
Adds repo-specific Copilot instructions (branch model/commit rules/code style). |
.github/CODEOWNERS |
Expands ownership rules with area-specific reviewers and ordering notes. |
Comments suppressed due to low confidence (1)
zi.zsh:1197
- Same issue as above:
.zi-compinit 1 1runscompinit -Cimmediately after adding the_zicompletion symlink. If the compdump doesn’t already include_zi,-Ccan skip regeneration and the completion won’t be picked up. Prefer running compinit without-Cwhen the completion files have just changed.
# Symlink _zi completion into _local---zi directory.
command ln -s "${ZI[PLUGINS_DIR]}/_local---zi/_zi" "${ZI[COMPLETIONS_DIR]}"
(( ${+functions[.zi-setup-plugin-dir]} )) || builtin source "${ZI[BIN_DIR]}/lib/zsh/install.zsh" || return 1
.zi-compinit 1 1 &>/dev/null
Comment on lines
1186
to
1190
| (( ${+functions[.zi-setup-plugin-dir]} )) || builtin source "${ZI[BIN_DIR]}/lib/zsh/install.zsh" || return 1 | ||
| (( ${+functions[.zi-confirm]} )) || builtin source "${ZI[BIN_DIR]}/lib/zsh/autoload.zsh" || return 1 | ||
| .zi-clear-completions &>/dev/null | ||
| .zi-compinit &>/dev/null | ||
| .zi-compinit 1 1 &>/dev/null | ||
| fi |
Comment on lines
589
to
594
| integer use_C=$2 | ||
|
|
||
| typeset -a symlinked backup_comps | ||
| local c cfile bkpfile action | ||
|
|
||
| symlinked=( "${ZI[COMPLETIONS_DIR]}"/_[^_.]*~*.zwc ) | ||
| backup_comps=( "${ZI[COMPLETIONS_DIR]}"/[^_.]*~*.zwc ) | ||
|
|
||
| # Delete completions if they are really there, | ||
| # either as completions (_fname) or backups (fname) | ||
| for c in "${symlinked[@]}" "${backup_comps[@]}"; do | ||
| action=0 | ||
| cfile="${c:t}" | ||
| cfile="_${cfile#_}" | ||
| bkpfile="${cfile#_}" | ||
|
|
||
| #print -Pr "${ZI[col-info]}Processing completion $cfile%f%b" | ||
| .zi-forget-completion "$cfile" | ||
| done | ||
|
|
||
| +zi-message "Initializing completion ({func}compinit{rst}){…}" | ||
| command rm -f "${ZI[ZCOMPDUMP_PATH]}" | ||
|
|
||
| # Workaround for a nasty trick in _vim | ||
| (( ${+functions[_vim_files]} )) && unfunction _vim_files | ||
| +zi-message "{mmdsh}{happy} Zi{rst} » {faint}initializing {func}compinit{rst}{…}" | ||
|
|
||
| builtin autoload -Uz compinit | ||
| compinit ${${(M)use_C:#1}:+-C} -d "${ZI[ZCOMPDUMP_PATH]}" "${(Q@)${(z@)ZI[COMPINIT_OPTS]}}" |
| local set_mtime | ||
| .zi-get-mtime-into "${ZI[BIN_DIR]}/zi.zsh" "ZI[mtime]" | ||
| for set_mtime ( side install autoload additional ) { | ||
| .zi-get-mtime-into "${ZI[BIN_DIR]}/lib/zsh/${set_mtime}.zsh" "ZI[mtime-${set_mtime}]" |
Comment on lines
+697
to
+715
| ( | ||
| # Fetch the latest changes from the upstream repository | ||
| (( quiet )) || +zi-message "{mmdsh}{happy} Zi{rst} » {profile}fetching updates{rst}{…}" | ||
| builtin cd -q $ZI[BIN_DIR] && command git fetch $opt --jobs $cores --tags --prune --force $origin_url refs/heads/main && \ | ||
| lines=( ${(f)"$(command git log --color --abbrev-commit --decorate --date=short --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cd) %C(bold blue)<%an>%Creset' ..FETCH_HEAD)"} ) | ||
|
|
||
| # If there are any changes then update the codebase and reload Zi | ||
| if (( ${#lines} > 0 )); then | ||
| lines=( "${(S)lines[@]//\(([,[:blank:]]#(origin|HEAD|master|main)[^a-zA-Z]##(HEAD|origin|master|main)[,[:blank:]]#)#\)/}" ) | ||
| lines=( "${lines[@]/ \|\|[[:blank:]]#(#e)/}" ) | ||
| lines=( "${lines[@]/(#b)[[:space:]]#\|\|[[:space:]]#(*)(#e)/|| ${match[1]}}" ) | ||
| lines=( "${lines[@]/(#b)$escape([0-9]##)m[[:space:]]##${escape}m/$escape${match[1]}m${escape}m}" ) | ||
| lines=( "${lines[@]/(#b)[[:blank:]]#\|\|(*)(#e)/| ${${match[1]//$nl/ }[(w)1,(w)10]}}" ) | ||
| (( quiet )) || { builtin print -rl -- "${lines[@]}" | .zi-pager; } | ||
|
|
||
| if (( ! dry_run )); then | ||
| # Update the codebase | ||
| command git merge -n $opt --ff-only FETCH_HEAD || \ | ||
| { (( quiet )) || +zi-message "{mmdsh}{happy} Zi{rst} » {profile}update failed {quos}✘{rst}"; return 1 } |
| (( ${+functions[.zi-check-module]} )) || builtin source "${ZI[BIN_DIR]}/lib/zsh/side.zsh" || return 1 | ||
| .zi-check-module | ||
| (( ${+functions[.zi-module]} )) || builtin source "${ZI[BIN_DIR]}/lib/zsh/autoload.zsh" || return 1 | ||
| .zi-module --reset |
Comment on lines
9
to
12
| <h2 align="center"> | ||
| 🧙♂️ 🪄 A Swiss Army Knife for <a href="https://zsh.sourceforge.io/"><strong>Zsh</strong></a> - | ||
| <a href="https://en.wikipedia.org/wiki/Unix_shell">Unix Shell ✨</a> | ||
| <p><a href="https://en.wikipedia.org/wiki/Unix_shell">Unix Shell ✨</a></p> | ||
| </h2> |
Comment on lines
23
to
+29
| <td> | ||
| <div align="center"> | ||
| <a href="https://wiki.zshell.dev/search/"><strong>《💡》Search Wiki </strong></a> | ||
| <a href="https://wiki.zshell.dev/docs/getting_started/installation/"><strong>《⚡️》 Install </strong></a> | ||
| <a | ||
| href="https://github.com/z-shell/community/issues/new?assignees=&labels=%F0%9F%91%A5+member&template=membership.yml&title=team%3A+"><strong>《💜》Join | ||
| </strong></a> | ||
| <a href="https://translate.zshell.dev/"><strong>《🌐》Localize </strong></a> | ||
| </div> | ||
| <div align="center"><p><p></p> | ||
| <a href="https://wiki.zshell.dev/search/"><strong>⸨ ‑ 💡 Search Wiki ‑ ⸩</strong></a> | ||
| <a href="https://wiki.zshell.dev/docs/getting_started/installation/"><strong>⸨ ‑ ⚡️ Install ‑ ⸩</strong></a> | ||
| <a href="https://github.com/z-shell/community/issues/new?assignees=&labels=%F0%9F%91%A5+member&template=membership.yml&title=team%3A+"><strong>⸨ ‑ 💜 Join ‑ ⸩</strong></a> | ||
| <a href="https://translate.zshell.dev/"><strong>⸨ ‑ 🌐 Localize ‑ ⸩</strong></a> | ||
| </p></div> |
| [[ $+ZI_CIVIS == 1 && -n $TERM ]] && eval $ZI_CIVIS | ||
|
|
||
| if [[ -n $TERM ]] { | ||
| [[ $COLORTERM == (24bit|truecolor) || ${terminfo[colors]} -eq 16777216 ]] || \ |
Comment on lines
+27
to
+28
| zi_repo: ${{ github.repository }} | ||
| zi_ref: ${{ github.head_ref || github.ref_name }} |
Comment on lines
+1
to
+5
| --- | ||
| name: "🧪 ZD Integration" | ||
|
|
||
| on: | ||
| push: |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
labeler.yml,lock.yml,pr-labels.yml,rebase.yml,stale.yml.github/labeler.ymlconfig (no longer needed)codeql.yml) with v4 action, SHA-pinnedactions/checkoutreferences to full commit SHAsconcurrency:blocks to push/PR-triggered workflowsz-shell/zdref instead ofgithub.shazi.zshandlib/zsh/Test plan
.github/workflows/uses:lines reference full commit SHAs (no@v*or@mainrefs)trunk-check,zsh-n,zunit,zd-integration,codeqlworkflows pass on CIcommit-lintworkflow enforces conventional commits