Skip to content

refactor: remove vendored dependencies and related tooling - #345

Closed
rm3l wants to merge 3 commits into
RHIDP-16554-5--simplify-containerfilefrom
RHIDP-16554-6--remove-vendored-deps
Closed

rm3l wants to merge 3 commits into
RHIDP-16554-5--simplify-containerfilefrom
RHIDP-16554-6--remove-vendored-deps

Conversation

@rm3l

@rm3l rm3l commented Sep 7, 2026 •

Copy link
Copy Markdown
Member

Description

Remove all vendored dependencies and their management infrastructure now that the Go binary handles everything natively:

  • Removed: vendor/websocat/ Rust subtree (~528K), artifacts.lock.yaml (helm CGW lockfile)
  • Removed: 8 hack scripts (check-helm-binary-available, check-requirements-version, install-helm-binary, install-helm-local, install-openshift-client, update-helm-lockfile, update-vendor, verify-helm-tarball)
  • Removed: .github/workflows/vendor-update.yaml (weekly auto-update workflow)
  • Simplified: Makefile — removed vendor-related variables and targets (local-setup, vendor, helm-lockfile-update, vendor-update, run-script)
  • Updated: CI workflows — removed vendor exclusion patterns from scripts-checks, toml-checks, pr-build; removed oc/websocat installation from E2E test setup in test.yaml

Part of the Go rewrite epic (RHIDP-16540).

Which issue(s) does this PR fix or relate to

PR acceptance criteria

  • Tests — make go-build, make go-test, make go-lint all pass
  • Documentation

How to test changes / Special notes to the reviewer

make go-build    # Verify build still works without vendor infra
make go-test     # All Go tests pass
make go-lint     # No lint issues

The run-local-bash target is intentionally kept for A/B comparison with the bash implementation during the transition.

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. Required by Prow. label Sep 7, 2026
@rm3l
rm3l force-pushed the RHIDP-16554-6--remove-vendored-deps branch from f8f0b90 to b0d6096 Compare September 7, 2026 07:48
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Pre-commit hook failures

The pre-commit hooks detected issues that need to be fixed.

To fix these issues, either:

Option A — Comment /pre-commit on this PR to auto-fix and push changes (same-repo PRs only; not available for external forks).

Option B — Fix locally:

  1. Install pre-commit

  2. Run pre-commit on all files:

    pre-commit run --all-files
  3. Review and commit any auto-fixed changes:

    git add -u
    pre-commit run --all-files  # verify everything passes
    git commit

What the hooks check:

  • check-requirements-version — ensures .rhdh/docker/requirements.in matches the YQ_VERSION in the Makefile (auto-fixes on failure)
  • uv-pip-compile — regenerates .rhdh/docker/requirements.txt from requirements.in with pinned hashes (auto-fixes on failure)

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

PR images are available (for 1 week):

  1. quay.io/rhdh-community/rhdh-must-gather:pr-345
  2. quay.io/rhdh-community/rhdh-must-gather:pr-345-afb4cef4f

@rm3l
rm3l force-pushed the RHIDP-16554-6--remove-vendored-deps branch from afb4cef to 2f54eb1 Compare September 7, 2026 10:34
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

PR images are available (for 1 week):

  1. quay.io/rhdh-community/rhdh-must-gather:pr-345
  2. quay.io/rhdh-community/rhdh-must-gather:pr-345-2f54eb17f

@rm3l
rm3l force-pushed the RHIDP-16554-6--remove-vendored-deps branch from 2f54eb1 to 1d6d613 Compare September 7, 2026 21:29
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

PR images are available (for 1 week):

  1. quay.io/rhdh-community/rhdh-must-gather:pr-345
  2. quay.io/rhdh-community/rhdh-must-gather:pr-345-1d6d61337

@rm3l
rm3l marked this pull request as ready for review September 8, 2026 16:36
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. Required by Prow. label Sep 8, 2026
@rhdh-qodo-merge

Copy link
Copy Markdown

PR Summary by Qodo

Remove vendored dependencies and obsolete automation

⚙️ Configuration changes 🕐 40+ Minutes

Grey Divider

AI Description

• Remove vendored dependencies, artifact locks, and obsolete binary-management scripts.
• Simplify Make and CI paths around the native Go implementation.
• Retire pre-commit and vendor-update automation tied to removed tooling.
Diagram

graph TD
  DEV["Developer"] --> MAKE["Make targets"] --> GO["Go binary"] --> K8S["Cluster APIs"]
  CI["CI workflows"] --> MAKE
  E2E["E2E tests"] --> GO
  MAKE --> BASH["Legacy Bash"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Stage downstream migration first
  • ➕ Prevents downstream or hermetic builds from referencing deleted scripts and vendor assets.
  • ➕ Allows documentation and packaging consumers to migrate before cleanup.
  • ➖ Temporarily retains obsolete dependency-management infrastructure.
  • ➖ Delays completion of the Go rewrite cleanup.
2. Retain focused pre-commit hooks
  • ➕ Preserves automated Python requirements lock regeneration.
  • ➕ Removes only the obsolete YQ version synchronization hook.
  • ➖ Keeps Python and pre-commit workflow maintenance in the repository.
  • ➖ May be unnecessary if legacy requirements files are also being retired.

Recommendation: Removing duplicate vendor infrastructure is the correct end state, but it should be atomic with all remaining consumers. Confirm that downstream Containerfiles, requirements generation, and contributor documentation are migrated or intentionally retired; otherwise stage those migrations before deleting the supporting assets.

Files changed (5) +10 / -173

Refactor (1) +8 / -151
MakefileSimplify targets for native Go execution +8/-151

Simplify targets for native Go execution

• Removes local tool installers, vendor synchronization targets, Helm lockfile maintenance, and the per-script runner. Local and E2E targets now run without injected vendor tool paths, while the legacy Bash comparison target remains available.

Makefile

Other (4) +2 / -22
pr-build.yamlRemove legacy inputs from PR build detection +0/-3

Remove legacy inputs from PR build detection

• Stops treating collection scripts, vendored sources, and the artifact lockfile as inputs to the Go-based PR image build.

.github/workflows/pr-build.yaml

scripts-checks.yamlRemove vendor exclusions from shell checks +1/-6

Remove vendor exclusions from shell checks

• Eliminates obsolete vendor path filters from changed-file detection and ShellCheck now that vendored shell content is gone.

.github/workflows/scripts-checks.yaml

test.yamlDrop external oc and websocat setup +1/-9

Drop external oc and websocat setup

• Removes E2E installation of the OpenShift CLI and websocat because the Go binary now implements inspection and websocket behavior natively.

.github/workflows/test.yaml

toml-checks.yamlRemove vendor exclusions from TOML validation +0/-4

Remove vendor exclusions from TOML validation

• Allows TOML validation to operate without special handling for the removed vendored subtree.

.github/workflows/toml-checks.yaml

@rm3l
rm3l force-pushed the RHIDP-16554-6--remove-vendored-deps branch from 1d6d613 to bf1634b Compare September 8, 2026 16:40
@rhdh-qodo-merge

rhdh-qodo-merge Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (4) 📘 Rule violations (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Downstream container builds now fail 🐞 Bug ≡ Correctness
Description
The PR deletes the vendored WebSocket source and installer scripts while
.rhdh/docker/Containerfile still copies and executes those exact paths. Any build using that
Containerfile fails during COPY, before it can produce the downstream image.
Code

vendor/websocat/Cargo.toml[L1-3]

-[package]
-name = "websocat"
-version = "1.14.1"
Relevance

●●● Strong

The Containerfile actively consumes vendored WebSocket and installer paths; deleting them causes
build-time COPY failures.

PR-#137

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The downstream Containerfile copies vendor/websocat, copies and runs the deleted Helm installer,
and copies and runs the deleted OpenShift installer. It later copies the resulting legacy binaries
and Bash collection scripts into the final image, proving these are active build inputs rather than
stale comments.

.rhdh/docker/Containerfile[7-15]
.rhdh/docker/Containerfile[20-44]
.rhdh/docker/Containerfile[99-119]
.rhdh/docker/Containerfile[144-148]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The downstream `.rhdh/docker/Containerfile` still builds the vendored WebSocket client and invokes Helm and OpenShift installer scripts deleted by this PR. Rewrite it to package the Go collector without those removed inputs.

## Issue Context
The current Containerfile has three guaranteed missing `COPY` sources and still packages the legacy Bash collector and external binaries. Align the downstream image and its hermetic dependency configuration with the new root Go-native image.

## Fix Focus Areas
- .rhdh/docker/Containerfile[1-24]
- .rhdh/docker/Containerfile[99-119]
- .rhdh/docker/Containerfile[144-148]
- Containerfile[1-200]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. The Bash comparison fails on clean hosts 🐞 Bug ☼ Reliability
Description
The changed run-local-bash target drops local-setup and its managed tool path even though the
invoked Bash collector still requires Helm, yq, and WebSocket tooling. On a host without those
independently installed, initialization fails for missing Helm or later collection and inspector
heap dumps fail for missing yq or the WebSocket client.
Code

Makefile[55]

+run-local-bash: local-output ## Test using the original bash orchestrator (for comparison)
Relevance

●●● Strong

The retained Bash comparison target still invokes tools previously provisioned through local-setup.

PR-#284

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
run-local-bash invokes collection-scripts/must_gather, which immediately calls environment
initialization. That validation requires Helm, Helm gathering directly calls yq, and the inspector
implementation directly launches websocat.

Makefile[54-64]
collection-scripts/must_gather[53-59]
collection-scripts/common.sh[141-157]
collection-scripts/gather_helm[129-144]
collection-scripts/common.sh[815-855]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The intentionally retained Bash comparison target no longer provisions or locates the external tools required by the legacy collector. Restore a suitable setup prerequisite or explicitly validate and document all required host tools before invoking it.

## Issue Context
The Go collector no longer needs these binaries, but `run-local-bash` deliberately invokes the old implementation, which still does. Keep any restored setup isolated from the Go-native targets.

## Fix Focus Areas
- Makefile[54-64]
- collection-scripts/common.sh[141-157]
- collection-scripts/gather_helm[129-144]
- collection-scripts/common.sh[815-855]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Local end-to-end tests lose setup 🐞 Bug ☼ Reliability
Description
The changed test-e2e target removes local-setup and the downloaded-tools path even though
run-e2e-tests.sh still executes the Helm command directly. Running the documented Make target on a
workstation without system Helm now fails during fixture deployment instead of provisioning the
previously managed binary.
Code

Makefile[R91-94]

+test-e2e: ## Run E2E tests against a K8s cluster (requires Kind or similar)
ifneq ($(LOCAL),false)
	@echo "Running E2E tests in local mode..."
-	@PATH="$(abspath $(YQ_VENV)/bin):$(abspath $(TOOLS_DIR)):$$PATH" \
-		./tests/e2e/run-e2e-tests.sh --local \
+	@./tests/e2e/run-e2e-tests.sh --local \
Relevance

●●● Strong

Historical E2E changes explicitly fixed broken local-setup and Helm provisioning paths.

PR-#284

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The Make target now launches the E2E script without setup or PATH injection. The script
unconditionally uses helm install and helm template in its default fixture setup, so Helm
remains an external test-harness dependency.

Makefile[87-108]
tests/e2e/run-e2e-tests.sh[281-283]
tests/e2e/run-e2e-tests.sh[305-318]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`make test-e2e` still needs Helm for test fixture deployment, despite the Go collector no longer needing Helm itself. Ensure the target provisions Helm or performs a clear prerequisite check with documented installation requirements.

## Issue Context
This requirement comes from the E2E harness, not collector implementation. Preserve the removal of unnecessary WebSocket and OpenShift tools while retaining the Helm dependency needed by the tests.

## Fix Focus Areas
- Makefile[87-108]
- tests/e2e/run-e2e-tests.sh[266-318]
- CONTRIBUTING.md[11-35]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


4. Contributor instructions now fail 🐞 Bug ⚙ Maintainability
Description
The PR deletes the run-script, vendoring targets, pre-commit configuration, and associated
workflows without updating CONTRIBUTING.md, which still presents all of them as supported
processes. Contributors following that guide receive missing-target or missing-configuration errors
and are told that a CI check exists after it has been removed.
Code

Makefile[L104-105]

-.PHONY: run-script
-run-script: local-output local-setup ## Test the specified gather-<SCRIPT> script (set the SCRIPT var)
Relevance

●●● Strong

The repository historically updates CONTRIBUTING alongside Makefile target renames, making stale
instructions actionable.

PR-#35

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The guide advertises the deleted run-script target, provides setup and execution instructions for
the deleted pre-commit configuration, claims its deleted workflow runs on every pull request, and
documents the removed vendor targets and subtree.

CONTRIBUTING.md[17-25]
CONTRIBUTING.md[37-69]
CONTRIBUTING.md[71-89]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Update the contributor guide to describe the Go-native development, testing, dependency, and CI workflows that remain after this refactor. Remove commands and setup instructions for deleted Make targets, vendoring infrastructure, and pre-commit workflows.

## Issue Context
The current guide still directs contributors to run `make run-script`, install pre-commit hooks from a deleted configuration, and manage the removed vendored WebSocket subtree.

## Fix Focus Areas
- CONTRIBUTING.md[11-35]
- CONTRIBUTING.md[37-69]
- CONTRIBUTING.md[71-89]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View medium (1)
5. Dependency lock drift reaches builds ✗ Dismissed 🐞 Bug ☼ Reliability
Description
Deleting the entire pre-commit configuration also removes the hooks that regenerate both hashed
Python requirements files, although those generated files and their inputs remain in the repository.
When either input changes, CI no longer detects a stale lockfile and the downstream hermetic image
can receive inconsistent dependencies or fail its hash-constrained installation.
Code

.pre-commit-config.yaml[L13-16]

-      - id: uv-pip-compile
-        name: uv pip compile (.rhdh/docker)
-        entry: uv pip compile --python-version=3.12 --python-platform=linux
-          --allow-unsafe --generate-hashes
Relevance

●●● Strong

Removing the sole lockfile regeneration hook leaves checked-in hashed requirements without
stale-lock validation.

PR-#137

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Both checked-in lockfiles identify themselves as generated by uv pip compile, and the downstream
Containerfile installs them with --require-hashes. No remaining workflow validates their
relationship to the .in files after this configuration and its runner workflow are deleted.

.rhdh/docker/requirements.txt[1-6]
.rhdh/docker/requirements-build.txt[1-6]
.rhdh/docker/requirements-build.in[1-15]
.rhdh/docker/Containerfile[105-113]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Preserve CI validation that the checked-in hashed Python requirements files match their source inputs, or remove the Python dependency path as part of rewriting the downstream image. Do not retain generated lockfiles consumed by a build without an automated drift check.

## Issue Context
The dangling yq-version hook can be removed because its Makefile variable is gone, but the two independent `uv pip compile` checks still protect files currently installed by `.rhdh/docker/Containerfile`.

## Fix Focus Areas
- .pre-commit-config.yaml[12-36]
- .github/workflows/pre-commit.yaml[1-34]
- .rhdh/docker/requirements.in[1-2]
- .rhdh/docker/requirements-build.in[1-15]
- .rhdh/docker/Containerfile[105-113]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
✅ Compliance rules (platform): 7 rules
✅ Cross-repo context — repo relationships
  Explored: repo: redhat-developer/rhdh-chart (sha: 3ac5278f)
Review mode: ⚖️ Balanced: This is primarily a large, shallow deletion and tooling cleanup; while CI and Makefile removals warrant careful review, it lacks substantial new or independently modified logic requiring redundant passes.

Grey Divider

Tip of the day
💡 Did you know, you can reply 'qodo' on any finding to push back, ask questions, or dig deeper

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread vendor/websocat/Cargo.toml Resolved
Comment thread Makefile Resolved
Comment thread Makefile Resolved
Comment thread .pre-commit-config.yaml Resolved
Comment thread Makefile Resolved
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

PR images are available (for 1 week):

  1. quay.io/rhdh-community/rhdh-must-gather:pr-345
  2. quay.io/rhdh-community/rhdh-must-gather:pr-345-bf1634b25

@rm3l
rm3l force-pushed the RHIDP-16554-6--remove-vendored-deps branch from bf1634b to afa7f53 Compare September 8, 2026 17:28
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

PR images are available (for 1 week):

  1. quay.io/rhdh-community/rhdh-must-gather:pr-345
  2. quay.io/rhdh-community/rhdh-must-gather:pr-345-afa7f53cf

@rm3l
rm3l force-pushed the RHIDP-16554-6--remove-vendored-deps branch from afa7f53 to 83ce9f1 Compare September 9, 2026 14:41
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

PR images are available (for 1 week):

  1. quay.io/rhdh-community/rhdh-must-gather:pr-345
  2. quay.io/rhdh-community/rhdh-must-gather:pr-345-83ce9f1a2

@rm3l
rm3l force-pushed the RHIDP-16554-6--remove-vendored-deps branch from 83ce9f1 to 7a80f5c Compare September 14, 2026 20:47
@github-actions

Copy link
Copy Markdown
Contributor

PR images are available (for 1 week):

  1. quay.io/rhdh-community/rhdh-must-gather:pr-345
  2. quay.io/rhdh-community/rhdh-must-gather:pr-345-7a80f5c2f

With the Go rewrite handling helm, oc inspect, and websockets
natively, the vendored binaries and their management infrastructure
are no longer needed. Remove vendor/websocat/ subtree,
artifacts.lock.yaml (helm CGW lockfile), and all hack scripts for
vendor installation and updates. Simplify the Makefile by dropping
vendor-related targets and variables. Update CI workflows to remove
vendor exclusion patterns and binary tool installations that the Go
binary now replaces.

Assisted-by: Claude
The pre-commit hooks referenced hack/check-requirements-version.sh
which was removed in this branch. Remove the config to avoid CI
failures from dangling hook references.

Assisted-by: Claude
Remove the three pre-commit workflows (run, fix, comment) alongside
the config file removed in the previous commit. Without a config
file, the workflows fail immediately.

Assisted-by: Claude
@rm3l
rm3l force-pushed the RHIDP-16554-6--remove-vendored-deps branch from 7a80f5c to ab855a4 Compare September 15, 2026 12:02
@github-actions

Copy link
Copy Markdown
Contributor

PR images are available (for 1 week):

  1. quay.io/rhdh-community/rhdh-must-gather:pr-345
  2. quay.io/rhdh-community/rhdh-must-gather:pr-345-ab855a490

@rm3l

rm3l commented Sep 15, 2026

Copy link
Copy Markdown
Member Author

Merged to main via stacked PR merge in commit 2b78aa8. GitHub Stacks merge got stuck and failed to close this PR automatically.

@rm3l rm3l closed this Sep 15, 2026
@rm3l
rm3l deleted the RHIDP-16554-6--remove-vendored-deps branch September 15, 2026 13:14
rm3l added a commit to rm3l/redhat-developer-hub-must-gather that referenced this pull request Sep 15, 2026
…veloper#345)

* refactor: remove vendored dependencies and related tooling

With the Go rewrite handling helm, oc inspect, and websockets
natively, the vendored binaries and their management infrastructure
are no longer needed. Remove vendor/websocat/ subtree,
artifacts.lock.yaml (helm CGW lockfile), and all hack scripts for
vendor installation and updates. Simplify the Makefile by dropping
vendor-related targets and variables. Update CI workflows to remove
vendor exclusion patterns and binary tool installations that the Go
binary now replaces.

Assisted-by: Claude

* refactor: remove pre-commit config

The pre-commit hooks referenced hack/check-requirements-version.sh
which was removed in this branch. Remove the config to avoid CI
failures from dangling hook references.

Assisted-by: Claude

* refactor: remove pre-commit CI workflows

Remove the three pre-commit workflows (run, fix, comment) alongside
the config file removed in the previous commit. Without a config
file, the workflows fail immediately.

Assisted-by: Claude
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