-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Conversation
97aa249
to
e81c127
Compare
e81c127
to
7efb1b4
Compare
command: | ||
type: object | ||
required: ['command'] | ||
version: { const: 1 } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we bump the version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? No-one has used this yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But we are changing the file format
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Versioning here is to prevent misunderstandings about what the file means; in particular, to make sure that you aren't giving fluxd an instruction it doesn't know how to carry out.
Can you think of a potential mistake that would be avoided by bumping the version here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not absolutely against it, but it does mean writing code that would discriminate between the two versions (assuming we'd want to not invalidate everyone's config immediately.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you think of a potential mistake that would be avoided by bumping the version here?
No, not really.
I am not absolutely against it, but it does mean writing code that would discriminate between the two versions (assuming we'd want to not invalidate everyone's config immediately.)
Yeah, that's a pain.
I think that, technically, we should bump the version number but I am not sure it's worth the pain.
Maybe we could use minor version numbers for backward-compatible syntax changes (without needing to handle it differently in the code). Or maybe we can just leave it at version 1 .
Can you extend the |
Now I'm writing some docs, it occurs to me that this:
looks like it says "include the following files (none)". The map value Thinking thinking thinking ... |
7efb1b4
to
1550672
Compare
Use another word:
Use another, constant value:
Of these I think I prefer the first. |
how about something a bit more descriptive
|
I like
|
Yeah I like it for that reason too; it's just that the empty value (for now, the only possible value) gives the wrong impression. |
To date there's been some gentle checks on .flux.yaml files, but it's still easy to (for example) include a patchFile field with a commandUpdated config, and think that it should work. Putting a full schema in means mistakes get caught much earlier.
This adds the schema and struct for a `files` field in `.flux.yaml`. This is one of the alternatives for how to generate files, and is intended to mean "act as though there were no .flux.yaml` in effect" (implementation to follow ..).
This adds a special case for a config file that acts as a reset switch, by having a `files: ` entry instead of `patchUpdated` or `commandUpdated`. Since the desired behaviour is to act as though there were _no_ config file in effect, by far the most direct implementation is to add the path in question to the collection of raw files paths when a config file containing the directive is found.
1550672
to
a455a83
Compare
Replaced |
The required form of a .flux.yaml using files is version: 1 files: {} which looks an awful lot like indicating that no files should be processed. In this commit I've renamed the directive to `scanForFiles`, which is less likely to cause this particular confusion.
9fd9be4
to
638bd7a
Compare
Merge it while it's hot! Thanks @2opremio and @stefanprodan for reviews and comments. |
Briefly: let people reset the processing rules in
.flux.yaml
, so you can have a.flux.yaml
at the top of the git repo, but switch that off for a particular--git-path
.(At present this is branched from another PR, because I will need to write a bit of documentation about this new thing, and better to do so in revised docs)