Open
Conversation
Currently this is a subcommand of the language server, which is weird because we don't expect the end user to directly download the language server binary and run commands. This change does the following: * Removes the download code from the language server and removes the download-crds command * Adds an extract-crds command to fn-hcl-tools instead; this is something we ask the user to interact with * Changes the CRD source API definition type to remove the offline section. This is a breaking change but since we haven't released the language server.... * Changes the CRD extraction logic to process provider and configuration objects to get image references rather than the old processing that required a manual image list. This is consistent with how crossplane validate does this. Signed-off-by: gotwarlost <krishnan.anantheswaran@elastic.co>
Signed-off-by: gotwarlost <krishnan.anantheswaran@elastic.co>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR moves CRD download/extraction responsibilities out of the language server and into fn-hcl-tools, aligning user-facing workflows with the right binary while simplifying the LS runtime schema-loading model.
Changes:
- Added a new
internal/crdsextraction pipeline (YAML filtering + image discovery + xpkg image pulling) and a newfn-hcl-tools extract-crdscommand. - Removed the
download-crdslanguage-server subcommand and the associated caching/downloading implementation. - Simplified the CRD source API to remove the offline/runtime split (breaking schema change) and updated LS CRD source store usage accordingly.
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| function-hcl/internal/crds/api.go | Defines CRD extraction API types (Image/ObjectMetadata/Writer/Extractor). |
| function-hcl/internal/crds/extractor.go | Implements YAML scanning, image reference discovery, and remote package.yaml extraction. |
| function-hcl/internal/crds/writer.go | Adds writer implementations for streaming output and file splitting. |
| function-hcl/internal/crds/misc-writers.go | Adds progress/warning/multi-writer helpers. |
| function-hcl/cmd/fn-hcl-tools/extract-crds.go | Adds the new extract-crds CLI command and wiring to the extractor/writers. |
| function-hcl/cmd/fn-hcl-tools/main.go | Registers the new extract-crds command. |
| function-hcl/go.mod | Adds new dependencies (container registry, globbing) and bumps various versions. |
| function-hcl/go.sum | Updates sums for dependency changes. |
| function-hcl-ls/types/v1/crd-source.go | Removes offline/runtime config sections from the CRD source type. |
| function-hcl-ls/internal/features/crds/store/store.go | Updates CRD source loading to use the simplified CRD source type. |
| function-hcl-ls/internal/features/crds/store/source-store.go | Updates sourceInfo to store *types.CRDSource instead of runtime-only type. |
| function-hcl-ls/main.go | Removes registration of the download-crds command. |
| function-hcl-ls/internal/features/crds/api.go | Removes exported Download API. |
| function-hcl-ls/internal/features/crds/cache.go | Deletes legacy image download/cache implementation. |
| function-hcl-ls/internal/cmd/download-crds.go | Deletes the download-crds command implementation. |
| function-hcl-ls/mise.toml | Removes mise tool config from LS. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…lobs Signed-off-by: gotwarlost <krishnan.anantheswaran@elastic.co>
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.
Currently this is a subcommand of the language server, which is weird because we don't expect the end user to directly download the language server binary and run commands.
This change does the following:
extract-crdscommand tofn-hcl-toolsinstead; this is something we ask the user to interact with