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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core): allow disabling modules, services, tests + tasks in configs #1515

Merged
merged 4 commits into from
Jan 21, 2020

Conversation

edvald
Copy link
Collaborator

@edvald edvald commented Jan 15, 2020

What this PR does / why we need it:

This adds an optional disabled boolean field to all modules, and
where applicable to service, task and test config schemas.

The semantics are explained both in docs and unit tests, but they are
as follows:

  • Disabling a module disables all services, tasks and tests within it.
  • A disabled module may still be built if it is a build dependency of
    another module.
  • Disabled services are never deployed and are ignored if listed as
    runtime dependencies.
  • Disabled tasks are never run and are ignored if listed as
    runtime dependencies.
  • Disabled tests are never run.
  • An error is throw if trying to explicitly run a service, task or test
    via garden run ..., unless the --force flag is set.

Which issue(s) this PR fixes:

#1250

Special notes for your reviewer:

I've added a lot of tests here, but this is fairly difficult to cover. Please look for potential holes, both in terms of test coverage and functionality, and perhaps try testing manually if you're unsure if something works as expected.

thsig
thsig previously approved these changes Jan 20, 2020
Copy link
Collaborator

@thsig thsig left a comment

Choose a reason for hiding this comment

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

Looks good. We talked (offline) about adding another test or two for getModuleWatchTasks.

docs/using-garden/adding-services.md Outdated Show resolved Hide resolved
docs/using-garden/running-tasks.md Outdated Show resolved Hide resolved
docs/using-garden/running-tests.md Outdated Show resolved Hide resolved
This adds an optional `disabled` boolean field to all modules, and
where applicable to service, task and test config schemas.

The semantics are explained both in docs and unit tests, but they are
as follows:

- Disabling a module disables all services, tasks and tests within it.
- A disabled module may still be built if it is a build dependency of
  another module.
- Disabled services are never deployed and are ignored if listed as
  runtime dependencies.
- Disabled tasks are never run and are ignored if listed as
  runtime dependencies.
- Disabled tests are never run.
- An error if throw if trying to explicitly run a service, task or test
  via `garden run ...`, unless the `--force` flag is set.
@edvald edvald requested a review from thsig January 20, 2020 16:46
@edvald edvald dismissed thsig’s stale review January 20, 2020 16:46

Need to review new commit

@edvald edvald added this to the 0.11.1 milestone Jan 20, 2020
Copy link
Collaborator

@thsig thsig left a comment

Choose a reason for hiding this comment

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

LGTM.

edvald and others added 2 commits January 21, 2020 12:24
This adds a bit of future-proofing for schema changes to test and task
results.

If unknown fields are not allowed in task and test results, new fields
stored on results generated by newer versions of the framework
may cause errors when read by older versions which do not recognize
the new fields.
@edvald edvald merged commit 54d74cc into master Jan 21, 2020
@edvald edvald deleted the module-toggle branch January 21, 2020 12:06
davestephens added a commit to davestephens/garden that referenced this pull request Jan 22, 2020
* 'master' of https://github.com/garden-io/garden: (32 commits)
  docs: added telemtry detail page
  fix: analytics make sure first event is flushed
  chore(ci): get minikube tests working for external contributors
  refactor(test): added tslint rule + removed js
  refactor(logger): add dataFormat to LogEntry
  fix(core): allow git URLs not ending in .git
  fix(test): improve error logging in e2e tests
  feat(core): allow disabling modules, services, tests + tasks in configs (garden-io#1515)
  fix(core): allow unknown in task & test results
  chore(github): phrasing for ranking in feat req templates
  chore(github): add feature request issue template
  improvement(core): detect rsync and ensure the version is recent enough
  chore(examples): update terraform example
  improvement(cli): use terminal-kit for better terminal compatibility
  chore(dashboard): lazy load modules + add error boundary
  docs: move provider and module type sections to top level
  docs: add documentation section for each provider
  docs: clarify version requirements for K8s and other dependencies
  chore: update stalebot config
  refactor: update Joi library
  ...
eysi09 pushed a commit that referenced this pull request Jan 22, 2020
…gs (#1515)

* feat(core): allow disabling modules, services, tests + tasks in configs

This adds an optional `disabled` boolean field to all modules, and
where applicable to service, task and test config schemas.

The semantics are explained both in docs and unit tests, but they are
as follows:

- Disabling a module disables all services, tasks and tests within it.
- A disabled module may still be built if it is a build dependency of
  another module.
- Disabled services are never deployed and are ignored if listed as
  runtime dependencies.
- Disabled tasks are never run and are ignored if listed as
  runtime dependencies.
- Disabled tests are never run.
- An error if throw if trying to explicitly run a service, task or test
  via `garden run ...`, unless the `--force` flag is set.
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.

3 participants