Skip to content

Conversation

@jakub-nt
Copy link
Contributor

@jakub-nt jakub-nt commented Jul 4, 2025

No description provided.

jakub-nt added 3 commits July 4, 2025 15:01
Signed-off-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com>
Signed-off-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com>
Signed-off-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com>
@jakub-nt jakub-nt requested a review from olehermanse July 4, 2025 13:28
Copy link
Member

@olehermanse olehermanse left a comment

Choose a reason for hiding this comment

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

Nice. Only small comments, feel free to fix in a follow-up PR.

For the `build` array, it must be inside each module object (with `name` as the key).
Local modules (files and folders in same directory as `cfbs.json`), must start with `./`, and end with `/` if it's a directory.
Module names should not be longer than 64 characters.
Module names (not including adfixes `./`, `/`, `.cf`, `.json` for local modules) should only contain lowercase ASCII alphanumeric characters possibly separated by dashes, and should start with a letter.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Module names (not including adfixes `./`, `/`, `.cf`, `.json` for local modules) should only contain lowercase ASCII alphanumeric characters possibly separated by dashes, and should start with a letter.
Module names (not including affixes `./`, `/`, `.cf`, `.json` for local modules) should only contain lowercase ASCII alphanumeric characters possibly separated by dashes, and should start with a letter.

Comment on lines +189 to +190
if not name.startswith("./"):
raise CFBSValidationError(name, "Local module names should begin with `./`")
Copy link
Member

@olehermanse olehermanse Jul 4, 2025

Choose a reason for hiding this comment

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

This is ensured by is_module_local(), so should be an assert / programmer error if that's not the case:

Suggested change
if not name.startswith("./"):
raise CFBSValidationError(name, "Local module names should begin with `./`")
assert name.startswith("./"), "is_module_local() should ensure this module starts with ./"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, but I thought this is safer since the implementation could change in the future.

@olehermanse olehermanse merged commit 61b4338 into cfengine:master Jul 4, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants