1
+ * Revision: [ 1.1] ( #revision-1.1 )
1
2
* RFC PR: [ concourse/rfcs #40 ] ( https://github.com/concourse/rfcs/pull/40 )
2
3
* Concourse Issue: [ concourse/concourse #5810 ] ( https://github.com/concourse/concourse/issues/5810 )
3
4
@@ -28,22 +29,24 @@ CLI uses `PIPELINE/JOB` notation for flags specifying a job, but this would be
28
29
ambiguous if your pipeline or job names allowed ` / ` in their name. For example,
29
30
` foo/bar/baz ` could either be (` foo/bar ` , ` baz ` ) or (` foo ` , ` bar/baz ` ).
30
31
31
- Allowing whitespace, capitalization, and mixed use of ` _ ` and ` - ` also results
32
- in inconsistent naming conventions between Concourse users. A 'deploy to prod'
33
- job may be called any of the following:
32
+ Allowing whitespace and capitalization along with ` _ ` and ` - ` results in
33
+ inconsistent naming conventions between Concourse users. A 'deploy to prod' job
34
+ may be called any of the following:
34
35
36
+ * ` prod-deploy `
35
37
* ` deploy to prod `
36
38
* ` deploy-to-prod `
37
39
* ` deploy_to_prod `
38
40
* ` Deploy to prod `
41
+ * ` deploy to Prod `
39
42
* ` Deploy to Prod `
40
43
41
- This variance is largely cosmetic and makes it difficult for a new Concourse
42
- user on an existing team to predict the name of a given job.
43
-
44
44
Permitting so many different naming conventions makes the Concourse UX, which
45
45
is largely text-based, feel inconsistent between different projects with
46
- different naming conventions.
46
+ different naming conventions. This inconsistency may seem insignficant to users
47
+ who only use Concourse within a single team, but it will become more pronounced
48
+ if/when the Concourse project introduces a central place to share re-usable
49
+ pipeline templates and other configuration.
47
50
48
51
Allowing spaces also makes it awkward to pass identifiers to the ` fly ` CLI, as
49
52
they would have to be explicitly quoted so they're not parsed as separate
@@ -60,17 +63,18 @@ reduce the allowed character set for Concourse identifiers.
60
63
61
64
The following characters will be permitted:
62
65
63
- * Unicode letters.
66
+ * Non-uppercase Unicode letters (i.e. lowercase or letter with no uppercase) .
64
67
* Decimal numbers.
65
- * Hyphens (` - ` ), as the canonical word separator .
68
+ * Hyphens (` - ` ) and underscores ( ` _ ` ) , as the canonical word separators .
66
69
* Periods (` . ` ), in order to support domain names and version numbers.
67
70
68
- All letters will be converted to lowercase. This is to enforce
69
- case-insensitivity and to present a consistent UI/UX while still supporting
70
- languages that don't have any casing (e.g. Japanese).
71
-
72
- Notably, the underscore character (` _ ` ) is forbidden. This is to further
73
- enforce consistency in word separators.
71
+ It's worth noting that both hyphens (` - ` ) and underscores (` _ ` ) are allowed as
72
+ word separators. While this may lead to the kind of fragmentation this proposal
73
+ aims to prevent, allowing both is more pragmatic than forbidding either: ` - ` is
74
+ already commonplace, while ` _ ` is more consistent with config params like
75
+ ` resource_types ` and is commonly used with other tools and naming conventions
76
+ (e.g. ` x86_64 ` ). The first iteration of this proposal did not allow the use of
77
+ underscore; see [ Revision 1.1] ( #revision-1.1 ) for details.
74
78
75
79
All identifiers must start with a valid letter. Allowing digits or symbols at
76
80
the beginning would allow for a few confusing situations:
@@ -86,30 +90,22 @@ With Go's [`re2`](https://github.com/google/re2/wiki/Syntax) syntax, a valid
86
90
identifier would be matched by the following regular expression:
87
91
88
92
``` re
89
- ^\p{L} [ \p{L }\d\- .] * $
93
+ ^[ \p{Ll}\p{Lt}\p{Lm}\p{Lo} ] [ \p{Ll}\p{Lt}\p{Lm}\p{Lo }\d\- . ] * $
90
94
```
91
95
92
- This scheme is very similar to the [restrictions on valid
93
- hostnames][valid-hostnames], with the exception that any Unicode letter is
94
- allowed instead of `a-z`. This similarity is incidental, but it's a convenient
95
- comparison to draw as hostnames and Concourse identifiers have similar needs:
96
- to be used in URLs, to be referenced from the commandline (`fly`), to be
97
- referenced in configuration (pipelines), and to be case-insensitive.
98
-
99
96
## Renaming existing data
100
97
101
- The following API resources can already be renamed manually:
98
+ All API resources can already be renamed manually:
102
99
103
100
* Pipelines can be renamed with `fly rename-pipeline`.
104
101
* Teams can be renamed with `fly rename-team`.
105
102
* Jobs can be renamed by updating their `name` and specifying the old name as
106
- [`old_name:`](https://concourse-ci.org/jobs.html#job-old-name). This will
107
- preserve their build history.
103
+ [`old_name`][jobs-old-name]. This will preserve the job's build history.
104
+ * Resources can be renamed in the same fashion by setting
105
+ [`old_name`][resources-old-name]. This will preserve the resource's state
106
+ (i.e. disabled versions, pinning).
108
107
* Step names can be renamed without any migration necessary.
109
108
110
- Resources cannot currently be renamed; support for doing so will need to be
111
- implemented before enforcing resource identifier validation.
112
-
113
109
## Easing the transition
114
110
115
111
Enforcing rules about identifiers is easy. Doing this in a way that doesn't
@@ -121,7 +117,9 @@ interact with mission-critical pipelines that have now-invalid identifiers
121
117
would be a major problem. Users should not be punished for upgrading.
122
118
123
119
To ease this pain, we can allow existing data to stay as-is, and only enforce
124
- the identifier rules for newly created teams and pipelines.
120
+ the identifier rules for newly created teams and pipelines. Additionally,
121
+ these validations can be implemented as warnings for a long period of time so
122
+ that users have time to adapt.
125
123
126
124
Existing data will still be fully functional and writable (i.e. updated with
127
125
`fly set-pipeline`, `fly set-team`), and Concourse can emit warnings for any
172
170
173
171
* n/a
174
172
173
+
174
+ # Revisions
175
+
176
+ ## Revision 1.1
177
+
178
+ In response to feedback in [concourse/concourse#6070][underscores-issue] this
179
+ RFC has been amended to allow the use of the underscore character (`_`) in
180
+ identifiers.
181
+
182
+
175
183
[var-sources-rfc]: https://github.com/concourse/rfcs/pull/39
176
- [valid-hostnames]: https://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_hostnames
184
+ [underscores-issue]: https://github.com/concourse/concourse/issues/6070
185
+ [jobs-old-name]: https://concourse-ci.org/jobs.html#schema.job.old_name
186
+ [resources-old-name]: https://concourse-ci.org/resources.html#schema.resource.old_name
0 commit comments