Skip to content

Pin PSScriptAnalyzer settings to shared org raw file#224

Merged
lipkau merged 12 commits into
masterfrom
shared-pssa-config
May 12, 2026
Merged

Pin PSScriptAnalyzer settings to shared org raw file#224
lipkau merged 12 commits into
masterfrom
shared-pssa-config

Conversation

@lipkau
Copy link
Copy Markdown
Member

@lipkau lipkau commented May 11, 2026

Summary

  • replace the minimal local analyzer settings with the shared JiraPS-derived baseline
  • add a Sync-PSScriptAnalyzerSettings step in Tools/setup.ps1 to fetch the shared rules file from AtlassianPS/.github
  • enforce raw-file pinning with SHA-256 validation before updating PSScriptAnalyzerSettings.psd1

Test plan

  • Run pwsh -NoLogo -NonInteractive -NoProfile -Command '& { Set-Location "./"; ./Tools/setup.ps1 }' in the ConfluencePS worktree
  • Confirm Invoke-Build -Task InstallDependencies completes during setup
  • Verify resulting PSScriptAnalyzerSettings.psd1 hash is stable locally
  • Re-run setup after AtlassianPS/.github shared-config PR merges to confirm remote sync succeeds without fallback

Depends on: https://github.com/AtlassianPS/.github/pull/new/shared-pssa-config

Made with Cursor

AtlassianPS Automated User and others added 12 commits May 11, 2026 23:25
Mirror the shared PSScriptAnalyzer settings locally and refresh from a pinned raw file during setup so ConfluencePS uses the same reviewed lint policy as other AtlassianPS modules.
Restore the local analyzer settings baseline expected by ConfluencePS tests and keep the pinned setup sync logic with a lint-compliant helper name.
Validate the shared analyzer payload via pinned commit and hash, but only overwrite local settings when explicitly requested to avoid CI regressions from baseline drift.
Switch to a PS5-compatible Join-Path expression so the setup script can resolve the local settings file in the Windows PowerShell CI lane.
Retain the commit-pinned raw source while removing SHA checks and handling download failures as warnings to match a lower-friction trust model.
Add a Tools/update.dependencies.ps1 helper that can refresh dependency versions and update the commit-pinned shared PSScriptAnalyzer settings URL in Tools/setup.ps1.
Download the pinned analyzer settings directly as response content in setup and keep the optional local write path for explicit updates.
Stop setup and pin-refresh workflows when shared PSScriptAnalyzer settings cannot be downloaded or resolved, so CI fails deterministically instead of continuing with stale or missing lint config.

Co-authored-by: Cursor <cursoragent@cursor.com>
Generate PSScriptAnalyzer settings from the pinned shared source on every setup run and stop tracking repo-local copies, so lint/build always use the pinned configuration without committing generated files.

Co-authored-by: Cursor <cursoragent@cursor.com>
Continue failing fast on pinned shared config download, but materialize the existing ConfluencePS analyzer profile so current test baselines stay green while the shared source remains reachable.

Co-authored-by: Cursor <cursoragent@cursor.com>
Materialize the pinned shared PSScriptAnalyzer settings in setup and reformat the flagged ConfluencePS files so the repository passes the stricter shared lint profile.

Co-authored-by: Cursor <cursoragent@cursor.com>
Write the setup script as UTF-8 without BOM so style checks and generated release files keep repository encoding conventions.

Co-authored-by: Cursor <cursoragent@cursor.com>
@lipkau lipkau merged commit 4310db8 into master May 12, 2026
7 checks passed
@lipkau lipkau deleted the shared-pssa-config branch May 12, 2026 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant