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-builder assembler config init --git-ref 2c41839a928e4fbb1f838ec46a05c81cbe346144

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

docs-builder assembler config init

Then you can force remote as a configuration source.

docs-builder assembler clone --config-source remote
docs-builder assembler build -c remote

--config-source and -c can be used interchangeably.

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

Every invocation of docs-builder and docs-assembler will indicate what config source is being used:

info ::e.d.c.tionFileProvider:: ConfigurationSource.Remote: git ref '2c41839a928e4fbb1f838ec46a05c81cbe346144', in /Users/mpdreamz/Library/Application Support/elastic/docs-builder/config-clone/config

Defaults if none are provided

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.

Create assembler workspaces

In an empty folder you can config init --local to clone the repository to the current working directory (pwd) instead. This makes it a lot easier to create a local assemble workspace to validate changes.

docs-builder assembler config init --local
docs-builder assembler clone -c local # (-c 'local' is default and can be omitted) 
docs-builder assembler build -c local # (-c 'local' is default and can be omitted) 

In a follow up we will add commands to build to pick up different checkouts more easily.

@Mpdreamz Mpdreamz requested a review from a team as a code owner September 11, 2025 14:50
@Mpdreamz Mpdreamz requested a review from cotti September 11, 2025 14:50
@Mpdreamz Mpdreamz self-assigned this Sep 11, 2025
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?

Copy link
Member Author

Choose a reason for hiding this comment

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

That check validates that if its passed it needs to be 32 characters in length.

This default still works if it was null.

@Mpdreamz Mpdreamz requested a review from cotti September 22, 2025 09:45
@Mpdreamz Mpdreamz force-pushed the feature/config-source-arg branch from d7abed9 to 8986e25 Compare September 24, 2025 12:07
@Mpdreamz Mpdreamz merged commit 31ea516 into main Sep 24, 2025
20 checks passed
@Mpdreamz Mpdreamz deleted the feature/config-source-arg branch September 24, 2025 12:23
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.

4 participants