You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this example, we have an endpoint `top_browsers.pipe` that groups website visits by browser to identify the most frequently used ones. We want to modify it to group the information by both browser and device.
In this example, we have an endpoint `top_browsers.pipe` that groups website visits by browser to identify the most frequently used ones. We want to modify it to group the information by both browser and device, that is, changing the API contract.
32
12
13
+
- Create a new endpoint `pipes/top_browsers_1.pipe`:
33
14
- (Optional) Add tests to the project to ensure that endpoint works as expected.
34
15
35
-
`tests/top_browser_default.test`:
16
+
`tests/top_browser_1_default.test`:
36
17
37
18
```bash
38
-
tb pipe data top_browsers --date_from 2024-01-11 --date_to 2024-01-12 --format CSV
19
+
tb pipe data top_browsers1 --date_from 2024-01-11 --date_to 2024-01-12 --format CSV
39
20
```
40
21
41
-
`tests/top_browser_default.test.result`:
22
+
`tests/top_browser_1_default.test.result`:
42
23
43
24
```
44
25
"browser","device","visits","hits"
@@ -47,31 +28,14 @@ tb pipe data top_browsers --date_from 2024-01-11 --date_to 2024-01-12 --format C
47
28
"chrome","mobile-android",1,1
48
29
```
49
30
50
-
- Add the flag `--skip-regression-tests` to your PR. This is required because Tinybird performs some automatic regression tests based on the endpoint's query log history. As we have changed the response of the endpoint, these automatic tests would fail. ([learn more about testing](https://versions.tinybird.co/docs/version-control/implementing-test-strategies.html)).
51
-
52
-
- As it is a **breaking change** let's deploy changes to a `Preview` release. This way we have both versions available in Tinybird. In this case we increase the major version, bump the semver version in `.tinyenv`.
53
-
54
-
`.tinyenv`:
55
-
```diff
56
-
- 0.0.0
57
-
+ 1.0.0
58
-
```
59
-
60
-
- Create a Pull Request with these changes and, once all the checks are satisfied, merge it. Then the `Preview` release will be created with the endpoint changes. From this moment, you can start to migrate all the API consumers to use the new version `1.0.0`. Just add `__tb__semver=1.0.0` to the url. Once `0.0.0` can be securely deprecated, promote `preview` to `live` following one of the next options:
61
-
62
-
- The action `Tinybird - Releases Workflow` in the case you are using our workflow templates.
63
-
- Promote from the UI.
64
-
- Or CLI:
65
-
66
-
```sh
67
-
tb release promote --semver 1.0.0
68
-
```
69
-
70
-
- Then you can get rid of `__tb__semver=1.0.0` on your service to be ready for next not breaking changes.
71
-
72
-
- In this case Tinybird rollback is available but not useful as your API consumer is not compatible wit both versions.
31
+
- As it is a **breaking change** you keep the old and new version so any client application can start using the new version or rollback to the previous one.
73
32
33
+
2. Non-breaking change
74
34
75
-
> In case we are iterating **not a breaking change** the way to go is just to Deploy to a `Live` release (bumping minor or patch in`.tinyenv`). API consumer does not require any change and Tinybird rollback is available.
In this example we'll add a new filter to the `top_browser.pipe` Pipe endpoint, without changing the API contract, that is a non-breaking change.
77
38
39
+
- Change the endpoint `pipes/top_browsers.pipe`
40
+
- (Optional) Add tests to the project, as described above, to ensure that endpoint works as expected
41
+
- Add the flag `--skip-regression-tests` to your PR. This is required because Tinybird performs some automatic regression tests based on the endpoint's query log history. As we have changed the response of the endpoint, these automatic tests would fail. ([learn more about testing](https://versions.tinybird.co/docs/production/implementing-test-strategies.html)).
0 commit comments