bullet_train 1.3.25 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f08f50d147fb7c6e08833c2e5aa5eb06f8dabd3300cd877155f4dca51b84148a
4
- data.tar.gz: ab7c997833b6b3b8ffb7d32ebec8e1259f9b08f420ed54b56f5184c4e13c2004
3
+ metadata.gz: a356bf776628bd7117355b5e70911db41a86840587a57aa3126681d8c29b0490
4
+ data.tar.gz: e7ffd1eabcbcc49000f2aee49d4a5454c624fa98040611db04772b587b245946
5
5
  SHA512:
6
- metadata.gz: 6ab2e949af4f19461b29ad9d8df5c8cd3ee0a194c15de5550adba3454147c37999398f2db1151bdea8ed34819be7e697e926b7bc9f184f3bec12d04a119ae10e
7
- data.tar.gz: 97039e1fe4a45618a8b03c3961982f52dd181f9174d193a29f99adaf061fbb73135edd4435281cc5fc306944828df3479641b785de60c0380c036f21001a28c5
6
+ metadata.gz: d31d5d44bfcbe47cd5f7e970d74001cd35b2c29dcecde1d024f6f7af3fd61c146db90727c7af3ba886f8662bb23e1aabdf5743316353e5fdd976237003e32cdd
7
+ data.tar.gz: 0723d0ec3dad3801f9d8fc7cd1303923d372971d524313b5af9d2192c18df9c5d1fb8d5057b1511f28f458e7431a700b6cbd79f219c4935c572923e18fe268fc
@@ -0,0 +1,90 @@
1
+ # Options For Upgrading Your Bullet Train Application
2
+
3
+ ## Quick Links
4
+
5
+ * [The YOLO Method (The original upgrade method)](/docs/upgrades/yolo.md)
6
+ * [The Stepwise Method - For `1.4.0` and above](/docs/upgrades)
7
+ * [Upgrade from any version to `1.4.0`](/docs/upgrades/yolo-140.md)
8
+ * [Upgrade from any version to `1.3.0`](/docs/upgrades/yolo-130.md)
9
+ * [Upgrade from `1.3.x` to `1.4.0`](/docs/upgrades/yolo-140.md)
10
+
11
+ ## About the upgrade process
12
+
13
+ The vast majority of Bullet Train's functionality is distributed via Ruby gems, but those gems depend on certain
14
+ hooks and initializers being present in the hosting application. Those hooks and initializers are provided by the
15
+ [starter repository](https://github.com/bullet-train-co/bullet_train).
16
+
17
+ Starting in mid-August of 2023 we began to iterate on how we publish gems and how we ensure that the starter repo
18
+ will get the version of the gems that it expects.
19
+
20
+ Starting with version `1.3.0` we began to explicitly update the starter repo every time that we released new
21
+ versions of the Bullet Train gems. Unfortunately, at that time we were only making changes to `Gemfile.lock`
22
+ which kind of hides the dependencies, and is often a source of merge conflicts that can be hard to sort out.
23
+
24
+ Starting with version `1.4.0` we added explicit version numbers for all of the Bullet Train gems to `Gemfile`,
25
+ which is less hidden and is not as prone to having merge conflicts as `Gemfile.lock`.
26
+
27
+ As a result of these changes, there are a few different ways that you might choose to upgrade your application
28
+ depending on which version you're currently on.
29
+
30
+ ## How to find your current version
31
+
32
+ You can easily find your current version by running `bundle show | grep "bullet_train "`.
33
+
34
+ For example:
35
+
36
+ ```
37
+ $ bundle show | grep "bullet_train "
38
+ * bullet_train (1.3.20)
39
+ ```
40
+
41
+ This app is on version `1.3.20`
42
+
43
+ ## How to upgrade
44
+
45
+ Depending on what version you're starting on, and what version you want to get to, you have a few options.
46
+
47
+ In general your two main options are:
48
+
49
+ 1. Upgrade directly from whatever version you happen to be on all the way to the latest published version.
50
+ 2. Do a series of stepwise upgrades from the version you're on to the version you want to get to.
51
+
52
+ ### Upgrade directly from any previous version to the latest version (aka The YOLO Method)
53
+
54
+ This was the original upgrade method that Bullet Train used for many years. It's still a perfectly useable way of
55
+ upgrading, though it feels a little... let's call it "uncontrolled" to some people. It can definitely lead to some
56
+ hairy merge conflicts if you haven't updated in a long time.
57
+
58
+ [Read more about The YOLO Method](/docs/upgrades/yolo.md)
59
+
60
+ ### Upgrade from `1.4.0` (or later) to any later version (aka The Standard Stepwise Method)
61
+
62
+ This is the new standard upgrade method that we recommend. If you've ever upgraded a Rails app from version to version
63
+ this process should feel fairly similar.
64
+
65
+ [Read more about The Stepwise Method](/docs/upgrades)
66
+
67
+ ### Upgrade from any previous verison to version `1.4.0` (a modified YOLO)
68
+
69
+ If you're on a version prior to `1.4.0` it can be a little tricky to do a stepwise upgrade to get to `1.4.0`. It's not
70
+ impossible (see below), but if you're feeling lucky you might start with making an attempt to upgrade your app directly to `1.4.0`.
71
+
72
+ [Read more about going directly to `1.4.0`](/docs/upgrades/yolo-140.md)
73
+
74
+ ### Upgrade from any previous verison to version `1.3.0` (and through the `1.3.x` line)
75
+
76
+ Since we weren't tracking version numbers in `Gemfile` (only `Gemfile.lock`) it can be a little tricky to upgrade
77
+ directly to `1.3.0`. With a few extra steps in the upgrade process it's (hopefully) not too terrible.
78
+
79
+ [Read more about going directly to `1.3.0`](/docs/upgrades/yolo-130.md)
80
+
81
+ ### Upgrade from `1.3.x` to version `1.4.0`
82
+
83
+ Once you make it to the end of the `1.3.x` line you only have one more step to get to the `1.4.0` branch. It's the
84
+ same instructions as if you wanted to upgrade to `1.4.0` from any previous version.
85
+
86
+ [Read more about going from `1.3.x` to `1.4.0`](/docs/upgrades/yolo-140.md)
87
+
88
+
89
+
90
+
@@ -0,0 +1,278 @@
1
+ # Upgrading Your Bullet Train Application to Version `1.3.0` and through the `1.3.x` line
2
+
3
+ <div class="rounded-md border bg-amber-100 border-amber-200 py-4 px-5 mb-3 not-prose">
4
+ <p class="text-sm text-amber-800 font-light mb-2">
5
+ If you're already on version <code>1.4.0</code> or later you should use
6
+ <a href="/docs/upgrades">The Stepwise Upgrade Method</a>
7
+ </p>
8
+ <p class="text-sm text-amber-800 font-light">
9
+ <a href="/docs/upgrades/options">Learn about other upgrade options.</a>
10
+ </p>
11
+ </div>
12
+
13
+ ## Getting to `1.3.0`
14
+
15
+ ### 1. Make sure you're working with a clean local copy.
16
+
17
+ ```
18
+ git status
19
+ ```
20
+
21
+ If you've got uncommitted or untracked files, you can clean them up with the following.
22
+
23
+ ```
24
+ # ⚠️ This will destroy any uncommitted or untracked changes and files you have locally.
25
+ git checkout .
26
+ git clean -d -f
27
+ ```
28
+
29
+ ### 2. Fetch the latest and greatest from the Bullet Train repository.
30
+
31
+ ```
32
+ git fetch bullet-train
33
+ git fetch --tags bullet-train
34
+ ```
35
+
36
+ ### 3. Create a new "upgrade" branch off of your main branch.
37
+
38
+ ```
39
+ git checkout main
40
+ git checkout -b updating-bullet-train-v1.3.0
41
+ ```
42
+
43
+ ### 4. Merge in the newest stuff from Bullet Train and resolve any merge conflicts.
44
+
45
+ ```
46
+ git merge v1.3.0
47
+ ```
48
+
49
+ It's quite possible you'll get some merge conflicts at this point. No big deal! Just go through and
50
+ resolve them like you would if you were integrating code from another developer on your team. We tend
51
+ to comment our code heavily, but if you have any questions about the code you're trying to understand,
52
+ let us know on Discord!
53
+
54
+ One of the files that's likely to have conflicts, and which can be the most frustrating to resolve is
55
+ `Gemfile.lock`. Unfortunately there are important changes in that file that we'll want to preserve.
56
+ Luckily there's a way to do it without having to resolve conflicts manually. We'll handle that in the
57
+ next step. For now you can just skip the updates in that file:
58
+
59
+ ```
60
+ git checkout HEAD -- Gemfile.lock
61
+ ```
62
+
63
+ Once you've resolved all the conflicts go ahead and commit the changes.
64
+
65
+ ```
66
+ git diff
67
+ git add -A
68
+ git commit -m "Upgrading Bullet Train."
69
+ ```
70
+
71
+ ### 5. Update `Gemfile`
72
+
73
+ Now we need to handle the situation with `Gemfile.lock` that we side-stepped earlier. you should open
74
+ up your `Gemfile` and find this block of gems:
75
+
76
+ ```ruby
77
+ # BULLET TRAIN GEMS
78
+ # This section is the list of Ruby gems included by default for Bullet Train.
79
+
80
+
81
+ # Core packages.
82
+ gem "bullet_train"
83
+ gem "bullet_train-super_scaffolding"
84
+ gem "bullet_train-api"
85
+ gem "bullet_train-outgoing_webhooks"
86
+ gem "bullet_train-incoming_webhooks"
87
+ gem "bullet_train-themes"
88
+ gem "bullet_train-themes-light"
89
+ gem "bullet_train-integrations"
90
+ gem "bullet_train-integrations-stripe"
91
+
92
+
93
+ # Optional support packages.
94
+ gem "bullet_train-sortable"
95
+ gem "bullet_train-scope_questions"
96
+ gem "bullet_train-obfuscates_id"
97
+ ```
98
+
99
+ Replace that entire block with this block:
100
+
101
+ ```ruby
102
+ # BULLET TRAIN GEMS
103
+ # This section is the list of Ruby gems included by default for Bullet Train.
104
+
105
+ # We use a constant here so that we can ensure that all of the bullet_train-*
106
+ # packages are on the same version.
107
+ BULLET_TRAIN_VERSION = "1.3.0"
108
+
109
+ # Core packages.
110
+ gem "bullet_train", BULLET_TRAIN_VERSION
111
+ gem "bullet_train-super_scaffolding", BULLET_TRAIN_VERSION
112
+ gem "bullet_train-api", BULLET_TRAIN_VERSION
113
+ gem "bullet_train-outgoing_webhooks", BULLET_TRAIN_VERSION
114
+ gem "bullet_train-incoming_webhooks", BULLET_TRAIN_VERSION
115
+ gem "bullet_train-themes", BULLET_TRAIN_VERSION
116
+ gem "bullet_train-themes-light", BULLET_TRAIN_VERSION
117
+ gem "bullet_train-integrations", BULLET_TRAIN_VERSION
118
+ gem "bullet_train-integrations-stripe", BULLET_TRAIN_VERSION
119
+
120
+ # Optional support packages.
121
+ gem "bullet_train-sortable", BULLET_TRAIN_VERSION
122
+ gem "bullet_train-scope_questions", BULLET_TRAIN_VERSION
123
+ gem "bullet_train-obfuscates_id", BULLET_TRAIN_VERSION
124
+
125
+ # Core gems that are dependencies of gems listed above. Technically they
126
+ # shouldn't need to be listed here, but we list them so that we can keep
127
+ # verion numbers in sync.
128
+ gem "bullet_train-fields", BULLET_TRAIN_VERSION
129
+ gem "bullet_train-has_uuid", BULLET_TRAIN_VERSION
130
+ gem "bullet_train-roles", BULLET_TRAIN_VERSION
131
+ gem "bullet_train-scope_validator", BULLET_TRAIN_VERSION
132
+ gem "bullet_train-super_load_and_authorize_resource", BULLET_TRAIN_VERSION
133
+ gem "bullet_train-themes-tailwind_css", BULLET_TRAIN_VERSION
134
+ ```
135
+
136
+ (We have to do this since we didn't start explicitly tracking versions until `1.4.0` and
137
+ want to make sure that our gem versions match what the starter repo expects.)
138
+
139
+ Then run `bundle update`
140
+
141
+ Then go ahead and commit the changes.
142
+
143
+ ```
144
+ git diff
145
+ git add -A
146
+ git commit -m "Upgrading Bullet Train gems."
147
+ ```
148
+
149
+ ### 5. Run Tests.
150
+
151
+ ```
152
+ rails test
153
+ rails test:system
154
+ ```
155
+
156
+ If anything fails, investigate the failures and get things working again, and commit those changes.
157
+
158
+ ### 6. Merge into `main` and delete the branch.
159
+
160
+ ```
161
+ git checkout main
162
+ git merge updating-bullet-train-v1.3.0
163
+ git push origin main
164
+ git branch -d updating-bullet-train-v1.3.0
165
+ ```
166
+
167
+ Alternatively, if you're using GitHub, you can push the `updating-bullet-train-v1.3.0` branch up and create a PR from it and let your CI integration do it's thing and then merge in the PR and delete the branch there. (That's what we typically do.)
168
+
169
+
170
+ ## Stepping to `1.3.x`
171
+
172
+ Before doing this you should have already followed the instructions above to get to version `1.3.0`.
173
+
174
+ For purposes of this example we'll assume that you're stepping up from `1.3.0` to `1.3.1`.
175
+
176
+ ### 1. Make sure you're working with a clean local copy.
177
+
178
+ ```
179
+ git status
180
+ ```
181
+
182
+ If you've got uncommitted or untracked files, you can clean them up with the following.
183
+
184
+ ```
185
+ # ⚠️ This will destroy any uncommitted or untracked changes and files you have locally.
186
+ git checkout .
187
+ git clean -d -f
188
+ ```
189
+
190
+ ### 2. Fetch the latest and greatest from the Bullet Train repository.
191
+
192
+ ```
193
+ git fetch bullet-train
194
+ git fetch --tags bullet-train
195
+ ```
196
+
197
+ ### 3. Create a new "upgrade" branch off of your main branch.
198
+
199
+ ```
200
+ git checkout main
201
+ git checkout -b updating-bullet-train-v1.3.1
202
+ ```
203
+
204
+ ### 4. Merge in the newest stuff from Bullet Train and resolve any merge conflicts.
205
+
206
+ ```
207
+ git merge v1.3.1
208
+ ```
209
+
210
+ It's quite possible you'll get some merge conflicts at this point. No big deal! Just go through and
211
+ resolve them like you would if you were integrating code from another developer on your team. We tend
212
+ to comment our code heavily, but if you have any questions about the code you're trying to understand,
213
+ let us know on Discord!
214
+
215
+ One of the files that's likely to have conflicts, and which can be the most frustrating to resolve is
216
+ `Gemfile.lock`. Unfortunately there are important changes in that file that we'll want to preserve.
217
+ Luckily there's a way to do it without having to resolve conflicts manually. We'll handle that in the
218
+ next step. For now you can just skip the updates in that file:
219
+
220
+ ```
221
+ git checkout HEAD -- Gemfile.lock
222
+ ```
223
+
224
+ Once you've resolved all the conflicts go ahead and commit the changes.
225
+
226
+ ```
227
+ git diff
228
+ git add -A
229
+ git commit -m "Upgrading Bullet Train."
230
+ ```
231
+
232
+ ### 5. Update `Gemfile`
233
+
234
+ Now we need to handle the situation with `Gemfile.lock` that we side-stepped earlier. you should open
235
+ up your `Gemfile` and find this line:
236
+
237
+ ```ruby
238
+ BULLET_TRAIN_VERSION = "1.3.0"
239
+ ```
240
+
241
+ Update that line with the new version you're moving to:
242
+
243
+ ```ruby
244
+ BULLET_TRAIN_VERSION = "1.3.1"
245
+ ```
246
+
247
+ (We have to do this since we didn't start explicitly tracking versions until `1.4.0` and
248
+ want to make sure that our gem versions match what the starter repo expects.)
249
+
250
+ Then run `bundle update`
251
+
252
+ Then go ahead and commit the changes.
253
+
254
+ ```
255
+ git diff
256
+ git add -A
257
+ git commit -m "Upgrading Bullet Train gems."
258
+ ```
259
+
260
+ ### 5. Run Tests.
261
+
262
+ ```
263
+ rails test
264
+ rails test:system
265
+ ```
266
+
267
+ If anything fails, investigate the failures and get things working again, and commit those changes.
268
+
269
+ ### 6. Merge into `main` and delete the branch.
270
+
271
+ ```
272
+ git checkout main
273
+ git merge updating-bullet-train-v1.3.1
274
+ git push origin main
275
+ git branch -d updating-bullet-train-v1.3.1`
276
+ ```
277
+
278
+ Alternatively, if you're using GitHub, you can push the `updating-bullet-train-v1.3.1` branch up and create a PR from it and let your CI integration do it's thing and then merge in the PR and delete the branch there. (That's what we typically do.)
@@ -0,0 +1,94 @@
1
+ # Upgrading Your Bullet Train Application to Version `1.4.0`
2
+
3
+ <div class="rounded-md border bg-amber-100 border-amber-200 py-4 px-5 mb-3 not-prose">
4
+ <p class="text-sm text-amber-800 font-light mb-2">
5
+ If you're already on version <code>1.4.0</code> or later you should use
6
+ <a href="/docs/upgrades">The Stepwise Upgrade Method</a>
7
+ </p>
8
+ <p class="text-sm text-amber-800 font-light">
9
+ <a href="/docs/upgrades/options">Learn about other upgrade options.</a>
10
+ </p>
11
+ </div>
12
+
13
+ ## Getting to `1.4.0`
14
+
15
+ ### 1. Make sure you're working with a clean local copy.
16
+
17
+ ```
18
+ git status
19
+ ```
20
+
21
+ If you've got uncommitted or untracked files, you can clean them up with the following.
22
+
23
+ ```
24
+ # ⚠️ This will destroy any uncommitted or untracked changes and files you have locally.
25
+ git checkout .
26
+ git clean -d -f
27
+ ```
28
+
29
+ ### 2. Fetch the latest and greatest from the Bullet Train repository.
30
+
31
+ ```
32
+ git fetch bullet-train
33
+ git fetch --tags bullet-train
34
+ ```
35
+
36
+ ### 3. Create a new "upgrade" branch off of your main branch.
37
+
38
+ ```
39
+ git checkout main
40
+ git checkout -b updating-bullet-train-v1.4.0
41
+ ```
42
+
43
+ ### 4. Merge in the newest stuff from Bullet Train and resolve any merge conflicts.
44
+
45
+ ```
46
+ git merge v1.4.0
47
+ ```
48
+
49
+ It's quite possible you'll get some merge conflicts at this point. No big deal! Just go through and
50
+ resolve them like you would if you were integrating code from another developer on your team. We tend
51
+ to comment our code heavily, but if you have any questions about the code you're trying to understand,
52
+ let us know on Discord!
53
+
54
+ One of the files that's likely to have conflicts, and which can be the most frustrating to resolve is
55
+ `Gemfile.lock`. You can try to sort it out by hand, or you can checkout a clean copy and then let bundler
56
+ generate a new one that matches what you need:
57
+
58
+ ```
59
+ git checkout HEAD -- Gemfile.lock
60
+ bundle update
61
+ ```
62
+
63
+ If you choose to sort out `Gemfile.lock` by hand it's a good idea to run `bundle install` just to make
64
+ sure that your `Gemfile.lock` agrees with the new state of `Gemfile`.
65
+
66
+ Once you've resolved all the conflicts go ahead and commit the changes.
67
+
68
+ ```
69
+ git diff
70
+ git add -A
71
+ git commit -m "Upgrading Bullet Train."
72
+ ```
73
+
74
+ ### 5. Run Tests.
75
+
76
+ ```
77
+ rails test
78
+ rails test:system
79
+ ```
80
+
81
+ If anything fails, investigate the failures and get things working again, and commit those changes.
82
+
83
+ ### 6. Merge into `main` and delete the branch.
84
+
85
+ ```
86
+ git checkout main
87
+ git merge updating-bullet-train-v1.3.0
88
+ git push origin main
89
+ git branch -d updating-bullet-train-v1.3.0
90
+ ```
91
+
92
+ Alternatively, if you're using GitHub, you can push the `updating-bullet-train-v1.3.0` branch up and create a PR from it and let your CI integration do it's thing and then merge in the PR and delete the branch there. (That's what we typically do.)
93
+
94
+
@@ -0,0 +1,91 @@
1
+ # The YOLO Approach To Upgrading Your Bullet Train Application
2
+
3
+ <div class="rounded-md border bg-amber-100 border-amber-200 py-4 px-5 mb-3 not-prose">
4
+ <p class="text-sm text-amber-800 font-light mb-2">
5
+ Note: We don't really recommend using this method.
6
+ <a href="/docs/upgrades/options">Learn about other upgrade options.</a>
7
+ </p>
8
+ <p class="text-sm text-amber-800 font-light">
9
+ If you're already on version <code>1.4.0</code> or later you should use
10
+ <a href="/docs/upgrades">The Stepwise Upgrade Method</a>
11
+ </p>
12
+ </div>
13
+
14
+ ## Pulling Updates from the Starter Repository
15
+
16
+ There are times when you'll want to pull updates from the starter repository into your local application. Thankfully, `git merge` provides us with the perfect tool for just that. You can simply merge the upstream Bullet Train repository into your local repository. If you haven’t tinkered with the starter repository defaults at all, then this should happen with no meaningful conflicts at all. Simply run your automated tests (including the comprehensive integration tests Bullet Train ships with) to make sure everything is still working as it was before.
17
+
18
+ If you _have_ modified some starter repository defaults _and_ we also happened to update that same logic upstream, then pulling the most recent version of the starter repository should cause a merge conflict in Git. This is actually great, because Git will then give you the opportunity to compare our upstream changes with your local customizations and allow you to resolve them in a way that makes sense for your application.
19
+
20
+ ### 1. Make sure you're working with a clean local copy.
21
+
22
+ ```
23
+ git status
24
+ ```
25
+
26
+ If you've got uncommitted or untracked files, you can clean them up with the following.
27
+
28
+ ```
29
+ # ⚠️ This will destroy any uncommitted or untracked changes and files you have locally.
30
+ git checkout .
31
+ git clean -d -f
32
+ ```
33
+
34
+ ### 2. Fetch the latest and greatest from the Bullet Train repository.
35
+
36
+ ```
37
+ git fetch bullet-train
38
+ ```
39
+
40
+ ### 3. Create a new "upgrade" branch off of your main branch.
41
+
42
+ ```
43
+ git checkout main
44
+ git checkout -b updating-bullet-train
45
+ ```
46
+
47
+ ### 4. Merge in the newest stuff from Bullet Train and resolve any merge conflicts.
48
+
49
+ ```
50
+ git merge bullet-train/main
51
+ ```
52
+
53
+ It's quite possible you'll get some merge conflicts at this point. No big deal! Just go through and resolve them like you would if you were integrating code from another developer on your team. We tend to comment our code heavily, but if you have any questions about the code you're trying to understand, let us know on Discord!
54
+
55
+ One of the files that's likely to have conflicts, and which can be the most frustrating to resolve is
56
+ `Gemfile.lock`. You can try to sort it out by hand, or you can checkout a clean copy and then let bundler
57
+ generate a new one that matches what you need:
58
+
59
+ ```
60
+ git checkout HEAD -- Gemfile.lock
61
+ bundle update
62
+ ```
63
+
64
+ If you choose to sort out `Gemfile.lock` by hand it's a good idea to run `bundle install` just to make
65
+ sure that your `Gemfile.lock` agrees with the new state of `Gemfile`.
66
+
67
+ Once you've resolved all the conflicts go ahead and commit the changes.
68
+
69
+ ```
70
+ git diff
71
+ git add -A
72
+ git commit -m "Upgrading Bullet Train."
73
+ ```
74
+
75
+ ### 5. Run Tests.
76
+
77
+ ```
78
+ rails test
79
+ rails test:system
80
+ ```
81
+
82
+ ### 6. Merge into `main` and delete the branch.
83
+
84
+ ```
85
+ git checkout main
86
+ git merge updating-bullet-train
87
+ git push origin main
88
+ git branch -d updating-bullet-train
89
+ ```
90
+
91
+ Alternatively, if you're using GitHub, you can push the `updating-bullet-train` branch up and create a PR from it and let your CI integration do it's thing and then merge in the PR and delete the branch there. (That's what we typically do.)
data/docs/upgrades.md CHANGED
@@ -1,16 +1,40 @@
1
1
  # Upgrading Your Bullet Train Application
2
2
 
3
- ## Upgrading the Framework
4
-
5
- The vast majority of Bullet Train's functionality is distributed via Ruby gems, so you can pull the latest updates by running `bundle update`.
3
+ <div class="rounded-md border bg-amber-100 border-amber-200 py-4 px-5 mb-3 not-prose">
4
+ <h3 class="text-sm text-amber-800 font-light mb-2">
5
+ Note: These ugrade steps have recently changed.
6
+ </h3>
7
+ <p class="text-sm text-amber-800 font-light mb-2">
8
+ These instructions assume that you're doing a stepwise upgrade on an app that's already on version <code>1.4.0</code> or later.
9
+ </p>
10
+ <p class="text-sm text-amber-800 font-light">
11
+ <a href="/docs/upgrades/options">Learn about other upgrade options.</a>
12
+ </p>
13
+ </div>
14
+
15
+ ## The Stepwise Upgrade Method
16
+
17
+ This method will ensure that the version of the Bullet Train gems that your app uses will stay in sync with the appliation framework provided by the starter repo.
18
+ If you've ever upgraded a Rails app from version to version this process should feel fairly similar.
6
19
 
7
20
  ## Pulling Updates from the Starter Repository
8
21
 
9
- There are times when you'll want to pull updates from the starter repository into your local application. Thankfully, `git merge` provides us with the perfect tool for just that. You can simply merge the upstream Bullet Train repository into your local repository. If you haven’t tinkered with the starter repository defaults at all, then this should happen with no meaningful conflicts at all. Simply run your automated tests (including the comprehensive integration tests Bullet Train ships with) to make sure everything is still working as it was before.
22
+ There are times when you'll want to update Bullet Train gems and pull updates from the starter repository into your local application.
23
+ Thankfully, `git merge` provides us with the perfect tool for just that. You can simply merge the upstream Bullet Train repository into
24
+ your local repository. If you haven’t tinkered with the starter repository defaults at all, then this should happen with no meaningful
25
+ conflicts at all. Simply run your automated tests (including the comprehensive integration tests Bullet Train ships with) to make sure
26
+ everything is still working as it was before.
27
+
28
+ If you _have_ modified some starter repository defaults _and_ we also happened to update that same logic upstream, then pulling the most
29
+ recent version of the starter repository should cause a merge conflict in Git. This is actually great, because Git will then give you the
30
+ opportunity to compare our upstream changes with your local customizations and allow you to resolve them in a way that makes sense for
31
+ your application.
32
+
33
+ ### 1. Decide which version you want to upgrade to
10
34
 
11
- If you _have_ modified some starter repository defaults _and_ we also happened to update that same logic upstream, then pulling the most recent version of the starter repository should cause a merge conflict in Git. This is actually great, because Git will then give you the opportunity to compare our upstream changes with your local customizations and allow you to resolve them in a way that makes sense for your application.
35
+ For the purposes of these instructions we'll assume that you're on version `1.4.0` and are going to upgrade to version `1.4.1`.
12
36
 
13
- ### 1. Make sure you're working with a clean local copy.
37
+ ### 2. Make sure you're working with a clean local copy.
14
38
 
15
39
  ```
16
40
  git status
@@ -24,47 +48,71 @@ git checkout .
24
48
  git clean -d -f
25
49
  ```
26
50
 
27
- ### 2. Fetch the latest and greatest from the Bullet Train repository.
51
+ ### 3. Fetch the latest and greatest from the Bullet Train repository.
28
52
 
29
53
  ```
30
54
  git fetch bullet-train
55
+ git fetch --tags bullet-train
31
56
  ```
32
57
 
33
- ### 3. Create a new "upgrade" branch off of your main branch.
58
+ ### 4. Create a new "upgrade" branch off of your main branch.
59
+
60
+ It can be handy to include the version number that you're moving to in the branch name.
34
61
 
35
62
  ```
36
63
  git checkout main
37
- git checkout -b updating-bullet-train
64
+ git checkout -b updating-bullet-train-1.4.1
38
65
  ```
39
66
 
40
- ### 4. Merge in the newest stuff from Bullet Train and resolve any merge conflicts.
67
+ ### 5. Merge in the newest stuff from Bullet Train and resolve any merge conflicts.
68
+
69
+ Each version of the starter repo is tagged, so you can merge in the tag from the upstread repo.
41
70
 
42
71
  ```
43
- git merge bullet-train/main
72
+ git merge v1.4.1
44
73
  ```
45
74
 
46
- It's quite possible you'll get some merge conflicts at this point. No big deal! Just go through and resolve them like you would if you were integrating code from another developer on your team. We tend to comment our code heavily, but if you have any questions about the code you're trying to understand, let us know on Discord!
75
+ It's quite possible you'll get some merge conflicts at this point. No big deal! Just go through and
76
+ resolve them like you would if you were integrating code from another developer on your team. We tend
77
+ to comment our code heavily, but if you have any questions about the code you're trying to understand,
78
+ let us know on [Discord!](https://discord.gg/bullettrain)
79
+
80
+ One of the files that's likely to have conflicts, and which can be the most frustrating to resolve is
81
+ `Gemfile.lock`. You can try to sort it out by hand, or you can checkout a clean copy and then let bundler
82
+ generate a new one that matches what you need:
83
+
84
+ ```
85
+ git checkout HEAD -- Gemfile.lock
86
+ bundle update
87
+ ```
88
+
89
+ If you choose to sort out `Gemfile.lock` by hand it's a good idea to run `bundle install` just to make
90
+ sure that your `Gemfile.lock` agrees with the new state of `Gemfile`.
91
+
92
+ Once you've resolved all the conflicts go ahead and commit the changes.
47
93
 
48
94
  ```
49
95
  git diff
50
96
  git add -A
51
- git commit -m "Upgrading Bullet Train."
97
+ git commit -m "Upgrading Bullet Train to v1.4.1."
52
98
  ```
53
99
 
54
- ### 5. Run Tests.
100
+ ### 6. Run Tests.
55
101
 
56
102
  ```
57
103
  rails test
58
104
  rails test:system
59
105
  ```
60
106
 
61
- ### 6. Merge into `main` and delete the branch.
107
+ ### 7. Merge into `main` and delete the branch.
62
108
 
63
109
  ```
64
110
  git checkout main
65
- git merge updating-bullet-train
111
+ git merge updating-bullet-train-1.4.1
66
112
  git push origin main
67
- git branch -d updating-bullet-train
113
+ git branch -d updating-bullet-train-1.4.1
68
114
  ```
69
115
 
70
- Alternatively, if you're using GitHub, you can push the `updating-bullet-train` branch up and create a PR from it and let your CI integration do it's thing and then merge in the PR and delete the branch there. (That's what we typically do.)
116
+ Alternatively, if you're using GitHub, you can push the `updating-bullet-train-1.4.1` branch up and create a
117
+ PR from it and let your CI integration do it's thing and then merge in the PR and delete the branch there.
118
+ (That's what we typically do.)
@@ -1,3 +1,3 @@
1
1
  module BulletTrain
2
- VERSION = "1.3.25"
2
+ VERSION = "1.4.0"
3
3
  end
@@ -295,7 +295,7 @@ namespace :bullet_train do
295
295
  end
296
296
  elsif flag == "--reset"
297
297
  if line.match?(/bullet_train/)
298
- line.gsub!(/,.*$/, "")
298
+ line.gsub!(/,.*$/, ", BULLET_TRAIN_VERSION")
299
299
  end
300
300
  puts "Resetting '#{package}' package in the Gemfile...".blue
301
301
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullet_train
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.25
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Culver
@@ -745,6 +745,10 @@ files:
745
745
  - docs/trademark.md
746
746
  - docs/tunneling.md
747
747
  - docs/upgrades.md
748
+ - docs/upgrades/options.md
749
+ - docs/upgrades/yolo-130.md
750
+ - docs/upgrades/yolo-140.md
751
+ - docs/upgrades/yolo.md
748
752
  - docs/webhooks/incoming.md
749
753
  - docs/webhooks/outgoing.md
750
754
  - docs/zapier.md