Commit 95689ea
authored
feat(jsii-diff): allow external stability to be treated as error (#4076)
In certain situations one might want to treat changes to `external` APIs as errors.
This could be to check the external APIs for any breaking changes and have an opportunity to selectively reject, heal or soften an upstream change.
This change introduces a new cli option `--error-on` which can be one of three classes:
| `--error-on` | Stabilities that cause an ERROR |
| ------------------ | -------------------------------------------------- |
| `prod` (default) | `stable`, `deprecated` |
| `non-experimental` | `stable`, `deprecated`, `external` |
| `all` | `stable`, `deprecated`, `experimental`, `external` |
**Fixes `deprecated` APIs not being treated as `stable`.**
In jsii, deprecations are treated as a stability.
However for the purpose of jsii-diff they should be treated as stable.
Otherwise one could do `stable -> deprecated, make breaking change, deprecated -> stable`, which should not be allowed.
We also can't prohibit the transition from deprecated back to stable, as it's perfectly okay to un-deprecate an API.
---
By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license].
[Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.01 parent 4fd596a commit 95689ea
File tree
4 files changed
+185
-61
lines changed- packages/jsii-diff
- bin
- lib
- test
4 files changed
+185
-61
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
6 | 7 | | |
7 | | - | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | | - | |
11 | | - | |
| 10 | + | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
21 | | - | |
| 23 | + | |
22 | 24 | | |
23 | | - | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
30 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
31 | 54 | | |
32 | 55 | | |
33 | 56 | | |
34 | | - | |
35 | | - | |
| 57 | + | |
| 58 | + | |
36 | 59 | | |
37 | 60 | | |
38 | | - | |
39 | | - | |
40 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
41 | 64 | | |
42 | | - | |
43 | | - | |
| 65 | + | |
| 66 | + | |
44 | 67 | | |
45 | 68 | | |
46 | 69 | | |
47 | 70 | | |
48 | | - | |
| 71 | + | |
49 | 72 | | |
50 | 73 | | |
51 | 74 | | |
52 | | - | |
| 75 | + | |
53 | 76 | | |
54 | 77 | | |
55 | 78 | | |
56 | 79 | | |
57 | 80 | | |
58 | | - | |
59 | | - | |
| 81 | + | |
| 82 | + | |
60 | 83 | | |
61 | 84 | | |
62 | 85 | | |
63 | 86 | | |
64 | 87 | | |
65 | 88 | | |
66 | 89 | | |
67 | | - | |
| 90 | + | |
68 | 91 | | |
69 | 92 | | |
70 | 93 | | |
71 | 94 | | |
72 | | - | |
| 95 | + | |
73 | 96 | | |
74 | 97 | | |
75 | 98 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
| 15 | + | |
| 16 | + | |
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
| |||
42 | 45 | | |
43 | 46 | | |
44 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
45 | 55 | | |
46 | 56 | | |
47 | 57 | | |
| |||
119 | 129 | | |
120 | 130 | | |
121 | 131 | | |
122 | | - | |
| 132 | + | |
123 | 133 | | |
124 | 134 | | |
125 | 135 | | |
126 | 136 | | |
127 | 137 | | |
128 | 138 | | |
129 | 139 | | |
130 | | - | |
| 140 | + | |
131 | 141 | | |
132 | 142 | | |
133 | 143 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
39 | 83 | | |
40 | 84 | | |
41 | 85 | | |
42 | 86 | | |
43 | 87 | | |
44 | | - | |
45 | | - | |
| 88 | + | |
| 89 | + | |
46 | 90 | | |
47 | 91 | | |
48 | 92 | | |
| |||
56 | 100 | | |
57 | 101 | | |
58 | 102 | | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
| 103 | + | |
| 104 | + | |
66 | 105 | | |
67 | 106 | | |
0 commit comments