Skip to content

ENT-14319: Added function to initialize promise-type/-module-projects - #198

Open
SimonThalvorsen wants to merge 1 commit into
cfengine:mainfrom
SimonThalvorsen:main
Open

ENT-14319: Added function to initialize promise-type/-module-projects#198
SimonThalvorsen wants to merge 1 commit into
cfengine:mainfrom
SimonThalvorsen:main

Conversation

@SimonThalvorsen

Copy link
Copy Markdown
Contributor

Ticket: ENT-14319
Changelog: None

@cf-bottom

Copy link
Copy Markdown

Thank you for submitting a PR! Maybe @craigcomstock can review this?

@olehermanse
olehermanse self-requested a review July 28, 2026 13:36
@SimonThalvorsen
SimonThalvorsen marked this pull request as draft July 28, 2026 17:06
@olehermanse
olehermanse marked this pull request as ready for review July 29, 2026 12:37
@olehermanse
olehermanse requested a review from larsewi July 29, 2026 12:38
Comment thread src/cfengine_cli/main.py Outdated
Comment thread src/cfengine_cli/main.py Outdated
Comment thread src/cfengine_cli/main.py Outdated
Comment thread src/cfengine_cli/main.py Outdated
Comment thread src/cfengine_cli/main.py Outdated
Comment thread src/cfengine_cli/commands.py
Comment thread src/cfengine_cli/initialize_project.py Outdated
Comment thread src/cfengine_cli/initialize_project.py Outdated
Comment thread src/cfengine_cli/initialize_project.py Outdated
Comment thread src/cfengine_cli/initialize_project.py Outdated

body file control
{{
namespace => "{namespace}";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think it's necessary to use a namespace here. You could have a __main__ bundle as the only bundle, or optionally have a test_example_name bundle for testing it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

When not using namespace I could not get the bundling in the cfbs build/provides to work. I then had to manually run the file if I wanted to test

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think that issue stems from trying to do the same in build and provides. Fundamentally you want 2 different things;

  • provides : Allow others to add your module, with the module doing nothing until they start using it.
  • build : Build and test the module with some dummy policy which your users will not need / want.

Comment thread src/cfengine_cli/initialize_project.py Outdated
Comment thread src/cfengine_cli/initialize_project.py Outdated

@olehermanse olehermanse left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good so far, left some suggestions / feedback. Will have more when I test it.

Ticket: ENT-14319
Changelog: None

Signed-off-by: Simon Halvorsen <simon.halvorsen@northern.tech>
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.

3 participants