Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for presets #151

Closed
pomek opened this issue Nov 29, 2022 · 1 comment 路 Fixed by #153
Closed

Support for presets #151

pomek opened this issue Nov 29, 2022 · 1 comment 路 Fixed by #153
Assignees
Labels
squad:devops Issue to be handled by the Devops team. type:feature
Milestone

Comments

@pomek
Copy link
Member

pomek commented Nov 29, 2022

馃摑 Provide a description of the new feature

Let's assume the following configuration as input. It uses tags, which we plan to introduce soon.

{
  "packages": "external/",
  "dependencies": {
    "ckeditor5-linters-config": "ckeditor/ckeditor5-linters-config@latest",
    "ckeditor5-dev": "ckeditor/ckeditor5-dev@latest"
  }
}

While bootstrapping the project (mrgit sync), mrgit clones and check-outs dependencies on the latest created tag.

A package published on npm may (but it does not have to) contain the same files as a tag on Github. Fortunately, the packages specified above do.

So, by default, sync will process repositories specified in the #dependencies key.

Presets

Let's assume I'd like to synchronize the entire project depending on events, e.g., when starting TP, preparing a release, etc.

An example configuration.

{
  "packages": "external/",
  "dependencies": {
    "ckeditor5-linters-config": "ckeditor/ckeditor5-linters-config@latest",
    "ckeditor5-dev": "ckeditor/ckeditor5-dev@latest"
  },
  "presets": {
    "dev": {
      "ckeditor5-linters-config": "ckeditor/ckeditor5-linters-config",
      "ckeditor5-dev": "ckeditor/ckeditor5-dev"
    },
    "typedoc": {
      "ckeditor5-dev": "ckeditor/ckeditor5-dev#ck/11721-build-API-from-typedoc"
    }
  }
}

And passing a preset name when using the sync command.

  • mrgit sync: all packages use the latest tag.
  • mrgit sync --preset dev: all packages are checked out on a #master branch.
  • mrgit sync --preset typedoc: ckeditor5-dev uses the #ck/11721-build-API-from-typedoc branch, linters - @latest.

In other words, when the --preset modifier is available, specified dependencies for the given preset are merged with the dependencies values. And preset takes precedence over dependencies.

@pomek pomek added type:feature squad:devops Issue to be handled by the Devops team. labels Nov 29, 2022
@przemyslaw-zan przemyslaw-zan self-assigned this Dec 2, 2022
@CKEditorBot CKEditorBot added status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. status:planned Set automatically when an issue lands in the "Sprint backlog" column. We will be working on it soon. and removed status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. status:planned Set automatically when an issue lands in the "Sprint backlog" column. We will be working on it soon. labels Dec 2, 2022
@przemyslaw-zan
Copy link
Member

If user were to execute command mrgit save --preset development with config file as follows:

{
	"packages": "external/",
	"dependencies": {
		"ckeditor5-linters-config": "ckeditor/ckeditor5-linters-config@latest",
		"ckeditor5-dev": "ckeditor/ckeditor5-dev@latest"
	},
	"presets": {
		"development": {
			"ckeditor5-dev": "ckeditor/ckeditor5-dev"
		}
	}
}

What would be expected outcome? I imagine that ckeditor5-dev should have its commit hash saved in the preset/development object. What about the ckeditor5-linters-config though?

  1. Its commit hash is not saved.
  2. Its commit hash gets saved in the dependencies object.
  3. It gets added to the preset/development object and its commit hash gets saved there.

Option 1 would mean that save does not save the exact state of the multirepo.
Option 2 would mean that default dependencies and other presets are affected.
Because of this, I come to the conclusion that correct behavior there is to add the ckeditor5-linters-config key along with its commit hash to the preset/development object.

@pomek pomek closed this as completed in #153 Dec 6, 2022
@pomek pomek closed this as completed in a86da0b Dec 6, 2022
@CKEditorBot CKEditorBot removed the status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. label Dec 6, 2022
@CKEditorBot CKEditorBot added this to the iteration 60 milestone Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
squad:devops Issue to be handled by the Devops team. type:feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants