Skip to content

Conversation

Mpdreamz
Copy link
Member

@Mpdreamz Mpdreamz commented Sep 11, 2025

Updates the init-config target to validate the passed --git-ref is actually the one that is checked out.

docs-assembler repo init-config --git-ref 2c41839a928e4fbb1f838ec46a05c81cbe346144

If you just want the latest/edge you can omit --git-ref

docs-assembler repo init-config

Then you can force init as a configuration source.

docs-assembler repo clone-all --config-source init
docs-assembler repo repo-all --config-source init

If the application folder init-config writes to is not available both of these will exit with an error code.

info ::e.d.c.tionFileProvider:: ConfigurationSource.Init: git ref '2c41839a928e4fbb1f838ec46a05c81cbe346144', in /Users/mpdreamz/Library/Application Support/elastic/docs-builder/config-clone/config
info ::e.d.t.f.foLoggerFilter:: Configuration source: Init
info ::e.d.t.f.foLoggerFilter:: Configuration source git reference: 2c41839a928e4fbb1f838ec46a05c81cbe346144

If --config-source is not provided it will default to ConfigurationSource.Local if config exists in the pwd, this is the default during development.

Otherwise ConfigurationSource.Embedded will use the configuration files embedded in the binary.

Copy link
Contributor

@cotti cotti left a comment

Choose a reason for hiding this comment

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

Just a note on RepositoryCommands, otherwise LGTM!

Comment on lines +74 to +75
if (string.IsNullOrEmpty(gitReference))
gitReference = "main";
Copy link
Contributor

Choose a reason for hiding this comment

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

This is unreachable due to the earlier if on gitref that exits with an error, isn't it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants