Skip to content

feat(blocks): support _ in block names and deprecate v1 #249

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

jaredallard
Copy link
Member

Deprecates V1 blocks by way of a persistent log message any time a v1
block is read from disk.

Adds support for _ in block names.

Deprecates V1 blocks by way of a persistent log message any time a v1
block is read from disk.

Adds support for `_` in block names.
Copy link

cloudflare-workers-and-pages bot commented Mar 5, 2025

Deploying stencil with  Cloudflare Pages  Cloudflare Pages

Latest commit: 1811cd0
Status: ✅  Deploy successful!
Preview URL: https://3d4b3283.stencil-1wj.pages.dev
Branch Preview URL: https://jaredallard-feat-support-und.stencil-1wj.pages.dev

View logs

@jaredallard
Copy link
Member Author

FYI @malept

Copy link

codecov bot commented Mar 5, 2025

Codecov Report

Attention: Patch coverage is 81.25000% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/codegen/blocks.go 62.50% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

@jaredallard jaredallard requested review from Copilot and deregtd March 5, 2025 02:08
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Overview

This PR adds support for underscores in block names and deprecates V1 blocks with a persistent warning message when a V1 block is read from disk. Key changes include:

  • Updating tool versions in .mise.toml and commenting out the old golangci-lint configuration.
  • Modifying the linters workflow to retrieve the new golangci-lint version.
  • Adding a deprecation warning for V1 blocks and updating block version handling and tests accordingly.

Reviewed Changes

File Description
.mise.toml Updated golang tool versions and replaced the old golangci-lint entry
.github/workflows/linters.yaml Changed the command to retrieve golangci-lint version, potentially affecting shell quoting
internal/codegen/file.go Added a deprecation warning for V1 blocks
internal/codegen/blocks.go Introduced BlockVersion type and updated regex to support "_" in block names
internal/codegen/blocks_test.go Updated test helpers to use a test logger and pass in the testing context
internal/codegen/template_test.go Updated usage of fakeBlocksTemplate to use the new signature

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

@jaredallard jaredallard merged commit 014c4cc into main Mar 5, 2025
5 checks passed
@jaredallard jaredallard deleted the jaredallard/feat/support-underscore-blocks-deprecate-v1 branch March 5, 2025 14:08
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.

4 participants