Skip to content

feat: Configurable Sync Config Location Override#32

Open
stevensJourney wants to merge 21 commits intomainfrom
configurable-sync-config-param
Open

feat: Configurable Sync Config Location Override#32
stevensJourney wants to merge 21 commits intomainfrom
configurable-sync-config-param

Conversation

@stevensJourney
Copy link
Collaborator

closes: #23

This adds a --sync-config-file-path=sync.yaml flag to various commands. This flag allows users to override the path to the sync config file. This flag is only added to commands which use sync config.

Implementation

The CLI commands generally fall into these categories:

  • Cloud instance commands: commands which act against a cloud instance
  • Self hosted instance commands: commands which act against a self hosted instance
  • Self hosted and cloud instance commands: commands which can act against either cloud or self hosted
  • Non instance specific commands: commands which don't necessarily involve an active instance, this includes commands which init instances.

The CloudInstanceCommand, SelfHostedInstanceCommand and SharedInstanceCommands base command classes handle the respective cases. By convention these commands have a loadProject method which loads the linked project, and also provides the sync config content (if available).

This PR adds additional hooks to the respective loadProject methods, in order to resolve the syncConfig - including the optional ability to override the default path for sync config.

Not all instance commands involve the use of Sync Config. For this reason, the --sync-config-file-path flag is only added to certain commands. The logic, and flag declaration, is added with a WithSyncConfigFilePath mixin.

While implementing the mixin. It was observed that OCLIF already has a built in mechanism for extending flags from base command classes. The commands are updated to use baseFlags when extending, instead of manual spreads. The command flag behaviour was verified to still be consistent with the previous implementation.

@stevensJourney stevensJourney marked this pull request as ready for review March 18, 2026 11:28
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.

[Feature Request] Sync Config Filepath Override

2 participants