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

fix(vcs): garden.yml changes now only affect relevant module version #1009

Merged
merged 2 commits into from
Jul 23, 2019

Conversation

edvald
Copy link
Collaborator

@edvald edvald commented Jul 23, 2019

Previously we were explicitly including the module config file in the
module version file list. Now we ensure that it is not included,
which is the intended behavior after we started hashing the actual
module config as part of the module version.

@edvald edvald requested a review from eysi09 July 23, 2019 14:12
@edvald edvald force-pushed the fix-multi-module-hash-issue branch from 723eb42 to dbdf989 Compare July 23, 2019 14:13
Copy link
Collaborator

@eysi09 eysi09 left a comment

Choose a reason for hiding this comment

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

Had a few questions. Also, if you have multiple modules in the same garden.yml, they should all be re-built on changes to that garden.yml, right?

@@ -148,6 +148,7 @@ export interface ModuleConfig

outputs: PrimitiveMap
path: string
configPath?: string
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this optional?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Because we don't always have a config file, e.g. when plugins specify modules.

@@ -96,6 +96,7 @@ export interface ProjectConfig {
kind: "Project",
name: string
path: string
configPath?: string
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same as above, shouldn't the config path be required?

@@ -106,23 +106,25 @@ export class Watcher {
return (path: string) => {
this.log.debug(`Watcher: File ${path} ${type}`)

const changedModules = modules.filter(m => m.version.files.includes(path))
const changedModules = modules
.filter(m => m.version.files.includes(path) || m.configPath === path)
Copy link
Collaborator

Choose a reason for hiding this comment

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

We're filtering on the configPath in at least three places. Should there be a generic function for this? Also feels like the type of thing one might forget.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Each filter clause is different, so I can't see how we'd make it more generic. And re: forgetting—that's what the tests are for .)

eysi09
eysi09 previously approved these changes Jul 23, 2019
@eysi09 eysi09 dismissed their stale review July 23, 2019 16:53

All modules get re-built on changes to garden.yml

@edvald
Copy link
Collaborator Author

edvald commented Jul 23, 2019

Looking into it

edvald added 2 commits July 23, 2019 19:22
Previously we were explicitly including the module config file in the
module version file list. Now we ensure that it is _not_ included,
which is the intended behavior after we started hashing the actual
module config as part of the module version.
@edvald edvald force-pushed the fix-multi-module-hash-issue branch from b879b98 to b8b8e99 Compare July 23, 2019 17:22
@edvald edvald changed the title fix(vcs): garden.yml changes should only affect relevant module version fix(vcs): garden.yml changes now only affect relevant module version Jul 23, 2019
@edvald edvald merged commit 2ff4edf into master Jul 23, 2019
@edvald edvald deleted the fix-multi-module-hash-issue branch July 23, 2019 17:43
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.

2 participants