Skip to content

Ck test - #193

Closed
KauzClay wants to merge 235 commits into
windows-2019from
ck-test
Closed

KauzClay wants to merge 235 commits into
windows-2019from
ck-test

Conversation

@KauzClay

Copy link
Copy Markdown
Contributor

No description provided.

Rajath Agasthya and others added 30 commits July 10, 2025 12:09
References to 2019 are changed to 2025. The `cis-merge-2019` files are
unchanged and needs inspection.
Signed-off-by: Clay Kauzlaric <clay.kauzlaric@broadcom.com>
Signed-off-by: Clay Kauzlaric <clay.kauzlaric@broadcom.com>
Signed-off-by: Clay Kauzlaric <clay.kauzlaric@broadcom.com>
OS version in the manifest is changed to windows2025. The other stemcell
tar file fixtures are unchanged because the tests using them don't care
about version.

Signed-off-by: Clay Kauzlaric <clay.kauzlaric@broadcom.com>
This is required in cases where 'default' network is not used in the GCP
project, as is the case for the demo GCP project.
This is required if there is a custom subnet in the network.
Error from packer: `Requested disk size cannot be smaller than the image
size (50 GB)`
Since concourse workers and GCP instance created by packer are on the
same shared VPC subnet, use internal IP for WinRM access. When external
IP is attached, it goes outside the network and that requires firewall
rules to enable WinRM access which we don't have permission to
create/modify.
AWS uses EC2Launch v2 by default for 2025 AMIs, so this commit changes
the way sysprep is invoked.
Signed-off-by: Clay Kauzlaric <clay.kauzlaric@broadcom.com>
These policies are copied from 2019 for now.
Signed-off-by: Brian Upton <brian.upton@broadcom.com>
Windows 2025 base VM uses a 100GB disk instead of 40GB.
This reverts commit 3ede9a6585db472312e119ef72df3abbbc04be68.
Since this director does not have a jumpbox, get rid of the SSH_TUNNEL_* params
(ref: cloudfoundry/windows-utilities-release@3bc17e7)
Previously, we were immediately creating a public image for GCP when we
built the stemcell. This is not allowed in labs, as we need to publish
to a separate account. This commit moves the publishing step to the end
of the pipeline, and replaces the previous publishing ruby code w/ a
bash script.

We have purposefully removed labeling because the dev and public images
now live in different accounts.

Signed-off-by: Brian Upton <brian.upton@broadcom.com>
ay901246 and others added 28 commits June 11, 2026 17:15
* Fix race condition in Windows Update check

This commit resolves a race condition in the `install-windows-updates` task
where the script prematurely exited the update loop after a reboot because
the Windows Update service was temporarily busy or starting up. We now
wrap the update check in a try/catch block and retry on failure.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Improve Windows Update robustness and prevent infinite loop

This commit adds several improvements to the `install-windows-updates` task:
1. Prevents infinite loops in CI by introducing a maximum retry counter (10-minute timeout).
2. Strips carriage returns (\r) and trailing whitespace from the captured update count to ensure the strict regex comparison succeeds.
3. Caps the returned update count at 250 in the guest.ps exit code to prevent 8-bit exit code truncation/wrapping.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
If you don't, you rely on the local cache.  Apparently we've been
implictly relying on the cache invalidation, but when you trigger
builds just often enough to refresh the cache before the KB for patch
tuesday is out, you'll NEVER get that patch.

Reconstructed timeline:
The pattern in the build history explains it. The pipeline ran roughly
weekly, and that timing was the key.

The Windows Update service automatically invalidates its local cache
after ~22 hours and triggers a fresh online scan the next time it's
queried. With builds 7 days apart:

Build 48 runs (Jun 3)  →  snapshot captured with fresh WU cache (0
pending) ← 7 days pass, WU cache becomes "stale" → Build 49 runs (Jun
10) →  WU service starts from 7-day-old snapshot → detects stale cache →
auto-refreshes online → finds 4 updates (those released since Jun 3)

For most of the build history (builds 34–48), the ~weekly cadence meant
the WU cache was always stale enough to trigger an automatic online
refresh. It looked like the pipeline was working correctly, but it was
actually depending on cache age to force a rescan.

KB5094128 fell through a specific timing gap:

1. Build 48 ran Jun 3 → cache captured, 0 pending
2. June 9 = Patch Tuesday → KB5094128 released
3. Build 49 ran Jun 10 → WU auto-refreshed (7-day-old cache) → but
   apparently found KB5087068 etc. and NOT KB5094128 yet, possibly
   because Patch Tuesday updates take 24–48 hours to fully propagate
   through Microsoft's CDN
4. Build 49 updates the snapshot → cache now shows "just scanned, 0
   pending" from the Jun 10 perspective — but KB5094128 still wasn't in
   it
5. Builds 50/51/52 run the same day or next day → WU cache is only hours
   old → auto-refresh doesn't trigger → KB5094128 never found

So the pipeline wasn't robust — it was relying on cache staleness, and
KB5094128 happened to be released during a window where a build ran
before the CDN propagation was complete, then the cache got "refreshed"
in a way that locked it at a state that excluded KB5094128. Every
subsequent same-day or next-day build saw that fresh cache and never
went online.

-Online skips all this: it always forces a query to Microsoft's servers
regardless of cache state, making the behavior deterministic instead of
dependent on build frequency and CDN timing.

ai-assisted=yes
[TNZ-108898]
This should have the same end result as the flag (making sure we don't
use a local cache).

ai-assisted=yes
[TNZ-108898]
ai-assisted=yes
[TNZ-148344] [Fusion] Bosh KTLO
@coderabbitai

coderabbitai Bot commented Sep 21, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: c18d546b-b024-4e9d-9f98-c2986e4ab41b

📥 Commits

Reviewing files that changed from the base of the PR and between 8d11a67 and a32c248.

⛔ Files ignored due to path filters (4)
  • Gemfile.lock is excluded by !**/*.lock
  • acceptance_test/assets/bwats-release/jobs/check-system/templates/2022-expected-policies/audit.csv is excluded by !**/*.csv
  • modules/BOSH.Sysprep/cis-merge-2022/DomainSysvol/GPO/Machine/microsoft/windows nt/Audit/audit.csv is excluded by !**/*.csv
  • stembuild/go.sum is excluded by !**/*.sum
📒 Files selected for processing (97)
  • .github/workflows/go.yml
  • .github/workflows/ruby.yml
  • Rakefile
  • acceptance_test/assets/bwats-release/jobs/check-system/spec
  • acceptance_test/assets/bwats-release/jobs/check-system/templates/2022-expected-policies/GptTmpl.inf
  • acceptance_test/assets/bwats-release/jobs/check-system/templates/2022-expected-policies/machine_registry.txt
  • acceptance_test/assets/bwats-release/jobs/check-system/templates/2022-expected-policies/user_registry.txt
  • acceptance_test/assets/bwats-release/jobs/check-system/templates/run.ps1
  • acceptance_test/main_test.go
  • ci/azstemcell/main.go
  • ci/azstemcell/main_test.go
  • ci/configure.sh
  • ci/pipelines/stemcells-windows.yml
  • ci/pipelines/vars.yml
  • ci/tasks/collect-base-amis/run
  • ci/tasks/create-aws-stemcell/task.yml
  • ci/tasks/create-azure-stemcell/task.yml
  • ci/tasks/create-gcp-stemcell/task.yml
  • ci/tasks/generate-deps-file/run.bash
  • ci/tasks/generate-deps-file/task.yml
  • ci/tasks/install-windows-updates/run.sh
  • ci/tasks/publish-gcp-stemcell/run
  • ci/tasks/publish-gcp-stemcell/task.yml
  • ci/tasks/rmt/build-release-config.sh
  • ci/tasks/rmt/build-release-config.yml
  • ci/tasks/run-bwats/task.yml
  • ci/tasks/zip-files/run.bash
  • ci/tasks/zip-files/task.yml
  • coverity.yaml
  • lib/packer/config/azure.rb
  • lib/packer/config/gcp.rb
  • lib/packer/config/templates/provision_windows2022.json.erb
  • lib/packer/sysprep_script_generator.rb
  • lib/stemcell/labeler/gcp.rb
  • lib/stemcell/publisher/gcp.rb
  • lib/tasks/build/aws.rake
  • lib/tasks/label/gcp.rake
  • lib/tasks/publish/gcp.rake
  • modules/BOSH.SSH/BOSH.SSH.Tests.ps1
  • modules/BOSH.SSH/BOSH.SSH.psd1
  • modules/BOSH.SSH/BOSH.SSH.psm1
  • modules/BOSH.Sysprep/BOSH.Sysprep.Tests.ps1
  • modules/BOSH.Sysprep/BOSH.Sysprep.psm1
  • modules/BOSH.Sysprep/cis-merge-2022/DomainSysvol/GPO/Machine/microsoft/windows nt/SecEdit/GptTmpl.inf
  • modules/BOSH.Sysprep/cis-merge-2022/DomainSysvol/GPO/Machine/registry.txt
  • modules/BOSH.Sysprep/cis-merge-2022/DomainSysvol/GPO/User/registry.txt
  • modules/BOSH.Utils/BOSH.Utils.Tests.ps1
  • modules/BOSH.Utils/BOSH.Utils.psm1
  • scripts/aws/setup_winrm.txt
  • scripts/gcp/setup-winrm.ps1
  • spec/fixtures/aws/amis/light-bosh-stemcell-1089.0-aws-xen-hvm-windows2022-go_agent-some-region-1.tgz
  • spec/fixtures/aws/amis/light-bosh-stemcell-1089.0-aws-xen-hvm-windows2022-go_agent-some-region-2.tgz
  • spec/fixtures/aws/amis/light-bosh-stemcell-1200.3.1-aws-xen-hvm-windows2022-go_agent-some-region-1.tgz
  • spec/fixtures/aws/amis/light-bosh-stemcell-1200.3.1-aws-xen-hvm-windows2022-go_agent-some-region-2.tgz
  • spec/fixtures/aws/amis/light-bosh-stemcell-1200.3.1-aws-xen-hvm-windows2022-go_agent-some-region-3.tgz
  • spec/fixtures/aws/amis/light-bosh-stemcell-1200.3.1-build.2-aws-xen-hvm-windows2019-go_agent-us-east-1.tgz
  • spec/fixtures/aws/amis/light-bosh-stemcell-1200.3.1-build.2-aws-xen-hvm-windows2022-go_agent-us-east-1.tgz
  • spec/integration/build/aws_spec.rb
  • spec/integration/build/azure_spec.rb
  • spec/integration/build/gcp_spec.rb
  • spec/packer/config/aws_spec.rb
  • spec/packer/config/azure_spec.rb
  • spec/packer/config/gcp_spec.rb
  • spec/packer/sysprep_script_generator_spec.rb
  • spec/stemcell/builder/aws_spec.rb
  • spec/stemcell/builder/azure_spec.rb
  • spec/stemcell/builder/gcp_spec.rb
  • spec/stemcell/packager_spec.rb
  • stembuild/README.md
  • stembuild/commandparser/package_stemcell_test.go
  • stembuild/construct/constructfakes/fake_iaas_client.go
  • stembuild/construct/vmconstruct.go
  • stembuild/construct/vmconstruct_test.go
  • stembuild/go.mod
  • stembuild/iaas_cli/iaas_clients/vcenter_client.go
  • stembuild/iaas_cli/iaas_clients/vcenter_client_test.go
  • stembuild/integration/construct/construct_test.go
  • stembuild/stemcell-automation/AutomationHelpers.Tests.ps1
  • stembuild/stemcell-automation/AutomationHelpers.psm1
  • stembuild/vendor/github.com/onsi/ginkgo/v2/CHANGELOG.md
  • stembuild/vendor/github.com/onsi/ginkgo/v2/internal/group.go
  • stembuild/vendor/github.com/onsi/ginkgo/v2/types/version.go
  • stembuild/vendor/go.yaml.in/yaml/v3/parserc.go
  • stembuild/vendor/go.yaml.in/yaml/v3/yamlh.go
  • stembuild/vendor/golang.org/x/net/http2/hpack/encode.go
  • stembuild/vendor/golang.org/x/net/http2/hpack/hpack.go
  • stembuild/vendor/golang.org/x/net/http2/hpack/tables.go
  • stembuild/vendor/golang.org/x/tools/go/ast/inspector/cursor.go
  • stembuild/vendor/golang.org/x/tools/go/packages/visit.go
  • stembuild/vendor/golang.org/x/tools/go/types/typeutil/callee.go
  • stembuild/vendor/golang.org/x/tools/internal/moremaps/maps.go
  • stembuild/vendor/golang.org/x/tools/internal/typesinternal/assignedaddress.go
  • stembuild/vendor/golang.org/x/tools/internal/typesinternal/classify_call.go
  • stembuild/vendor/golang.org/x/tools/internal/typesinternal/element.go
  • stembuild/vendor/golang.org/x/tools/internal/typesinternal/toonew.go
  • stembuild/vendor/golang.org/x/tools/internal/typesinternal/types.go
  • stembuild/vendor/modules.txt
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@KauzClay KauzClay closed this Sep 21, 2026
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.