Skip to content

chore: test updates, ai guidance, and pr template#46

Merged
briantwatson merged 4 commits into
mainfrom
chore/test-updates
Jun 4, 2026
Merged

chore: test updates, ai guidance, and pr template#46
briantwatson merged 4 commits into
mainfrom
chore/test-updates

Conversation

@briantwatson

@briantwatson briantwatson commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Description

  • Add t.Parallel() across all test packages
    • Given nature of these tests this is a wash, more out of principal at this time, but sets a standard here that is shared in other projects
  • minor fix %v → %w error wrapping in checkCRDExists
  • Add AI coding guidance with sub-guides for Go, Svelte, and frontend testing
  • Small PR template adjustment to match uds-core, PR title (commit) linting and commit signing (pr titles) are enforced.

Related Issue

N/A, updating tests following suggestion from @daveworth

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Other (security config, docs update, etc)

Steps to Validate

Tests pass

Checklist before merging

  • Tests and docs added or updated as needed
  • PR title follows Conventional Commits
  • Commits are signed

@briantwatson briantwatson requested a review from a team as a code owner June 3, 2026 19:33
@greptile-apps

greptile-apps Bot commented Jun 3, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds t.Parallel() to all Go test functions and subtests across the apps and incluster packages, fixes error wrapping in checkCRDExists (%v%w), and introduces AI coding guidance under .ai/ with sub-guides for Go, Svelte, and frontend testing.

  • Test parallelism: t.Parallel() is correctly applied at both the top-level test function and each subtest; all affected tests are stateless and safe to run concurrently.
  • Error wrapping fix: cluster.go now uses %w instead of %v, enabling callers to properly unwrap the error with errors.Is/errors.As.
  • Documentation: New .ai/ sub-guides and an expanded CLAUDE.md provide AI-assistable coding standards; the PR template is simplified, consolidating two checklist items into a single contributor-guide link (both requirements are now CI-enforced).

Confidence Score: 5/5

Safe to merge — changes are additive (docs, parallelism) and the one code change is a straightforward correctness fix.

All tests modified are stateless and use per-subtest fixtures, so the parallel annotations are safe. The %w fix in cluster.go is a correct improvement with no behavioral regression risk. Documentation additions are purely additive.

No files require special attention.

Important Files Changed

Filename Overview
src/pkg/api/apps/cluster.go One-line fix: %v%w in checkCRDExists to enable proper error chain unwrapping via errors.Is/errors.As
src/pkg/api/apps/apps_test.go Adds t.Parallel() to all top-level test functions and subtests; tests are stateless and safe to parallelize
src/pkg/api/apps/cluster_test.go Adds t.Parallel() to all top-level tests and subtests; each subtest creates its own isolated store/fixtures
src/pkg/api/auth/incluster/jwt_test.go Copyright updated to 2025-2026, t.Parallel() added to top-level test and subtests
.github/pull_request_template.md Consolidates separate CC and commit-signing checkboxes into a single "Contributor Guide followed" link; both requirements are now CI-enforced
CLAUDE.md Expanded with sub-guide pointers, behavior guidelines, and tooling commands; previously a one-liner

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[go test ./...] --> B[TestListPackages]
    A --> C[TestMetadataForPackage]
    A --> D[TestSecretNameForPackage]
    A --> E[TestFormatPackageName]
    A --> F[TestDisplayNameForApp]
    A --> G[TestEndpointURL]
    A --> H[TestToAPIApps]
    A --> I[TestFilterByUserGroup]
    A --> J[TestValidateJWT]

    B --> B1[subtest t.Parallel]
    C --> C1[subtest t.Parallel]
    D --> D1[subtest t.Parallel]
    E --> E1[subtest t.Parallel]
    F --> F1[subtest t.Parallel]
    G --> G1[subtest t.Parallel]
    H --> H1[subtest t.Parallel]
    I --> I1[subtest t.Parallel]
    J --> J1[subtest t.Parallel]
Loading

Reviews (1): Last reviewed commit: "chore: applying best practice" | Re-trigger Greptile

@briantwatson briantwatson changed the title chore: test updates chore: test updates Jun 3, 2026
@briantwatson briantwatson changed the title chore: test updates chore: test updates, ai guidance, and pr template Jun 3, 2026
@briantwatson

Copy link
Copy Markdown
Contributor Author

Left out config.go and config_test.go package from the t.Parallel() update as there is a package level variable that's mutated in both.

AdminAppsEnabled = true

Going to likely be pulling out the classification banner from those files (and the project) as it's now redundant with the UDS Core feature. When do that I can also address the variable for testing.

@briantwatson briantwatson merged commit dbaa3ea into main Jun 4, 2026
12 of 16 checks passed
@briantwatson briantwatson deleted the chore/test-updates branch June 4, 2026 17:37
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.

2 participants