Skip to content

Commit 27c6164

Browse files
authored
bugfix: validate process name to 18 characters (#2)
Data store names have a 50 character maximum. In the batch processor, we create a reserved Ordered Data Store named `_RBX_batch-process-failed-items-<process name>`, which reserves 32 of these 50 characters. Therefore, in order to be able to create this Ordered Data Store, the process name can be at most 18 characters long. This PR: - Updates the number of characters against which we validate the process name to 18 characters instead of 50 - Updates documentation with this value and ensures the examples given are within those limits
1 parent 9ebd87a commit 27c6164

File tree

3 files changed

+18
-15
lines changed

3 files changed

+18
-15
lines changed

GUIDE.html

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ <h1 id="-roblox-data-stores-batch-processor-cli-technical-guide-">
3434
repository and stage a pull request with your contributions. Please see the
3535
<strong><a href="./LICENSE">LICENSE</a></strong> for details. This tool uses
3636
third-party modules; their licenses are listed in
37-
<strong><a href="./ATTRIBUTIONS.md">ATTRIBUTIONS.md</a>.</strong>
37+
<strong><a href="./ATTRIBUTIONS.md">ATTRIBUTIONS.md</a></strong
38+
>.
3839
</p>
3940
<h2 id="-1-overview-"><strong>1. Overview</strong></h2>
4041
<p>
@@ -289,7 +290,8 @@ <h3 id="-4-1-process-keys-"><strong>4.1. process-keys</strong></h3>
289290
<ul>
290291
<li>
291292
<strong><code>&lt;process-name&gt;</code></strong
292-
>: The unique name of the new batch process.
293+
>: The unique name of the new batch process. The process name can be at most
294+
18 characters long.
293295
</li>
294296
</ul>
295297
<p><strong>Command-Specific Options:</strong></p>
@@ -335,7 +337,7 @@ <h3 id="-4-2-process-data-stores-">
335337
<ul>
336338
<li>
337339
<strong><code>&lt;process-name&gt;</code></strong> : The unique name of the
338-
new batch process.
340+
new batch process. The process name can be at most 18 characters long.
339341
</li>
340342
</ul>
341343
<p><strong>Command-Specific Options:</strong></p>
@@ -820,7 +822,7 @@ <h2 id="-8-example-use-case-data-deletion-">
820822
deletion:</strong
821823
>
822824
e.g.<br /><code
823-
>lune run batch-process process-keys DS_DELETION_JUNE17 -c &lt;config
825+
>lune run batch-process process-keys DS_Deletion -c &lt;config
824826
filepath&gt;.json</code
825827
>
826828
</li>
@@ -873,8 +875,8 @@ <h2 id="-8-example-use-case-data-deletion-">
873875
deletion:</strong
874876
>
875877
e.g.<br /><code
876-
>lune run batch-process process-data-stores DS_DELETION_JUNE17 -c
877-
&lt;config filepath&gt;.json</code
878+
>lune run batch-process process-data-stores DS_Deletion -c &lt;config
879+
filepath&gt;.json</code
878880
>
879881
</li>
880882
</ol>
@@ -1019,7 +1021,7 @@ <h3 id="-9-2-specific-example-datastore2-migration-deletion-">
10191021
</li>
10201022
<li>
10211023
Run the <code>process-data-stores</code> command, e.g.<br /><code
1022-
>lune run batch-process process-data-stores DS2_Migration_June17 -c
1024+
>lune run batch-process process-data-stores DS2_Migration -c
10231025
examples/ds2-config.json</code
10241026
>
10251027
</li>
@@ -1213,8 +1215,7 @@ <h4 id="-shared-optional-configurations-">
12131215
<td style="text-align: left"><code>--max-items-per-job</code></td>
12141216
<td style="text-align: left">50</td>
12151217
<td style="text-align: left">
1216-
Maximum number of items to process in one job. Note that if
1217-
<code>excludeDeletedKeys</code>
1218+
Maximum number of items to process in one job.
12181219
</td>
12191220
</tr>
12201221
<tr>

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ lune run batch-process process-keys <process-name> --config <filepath>
119119

120120
**Arguments:**
121121

122-
- **`<process-name>`**: The unique name of the new batch process.
122+
- **`<process-name>`**: The unique name of the new batch process. The process name can be
123+
at most 18 characters long.
123124

124125
**Command-Specific Options:**
125126

@@ -147,7 +148,8 @@ lune run batch-process process-data-stores <process-name> --config <filepath>
147148

148149
**Arguments:**
149150

150-
- **`<process-name>`** : The unique name of the new batch process.
151+
- **`<process-name>`** : The unique name of the new batch process. The process name can be
152+
at most 18 characters long.
151153

152154
**Command-Specific Options:**
153155

@@ -379,7 +381,7 @@ end
379381

380382
2. **Create the Configuration File** (or provide arguments on the command line)
381383
3. **Run the `process-keys` command to kick off the deletion:** e.g.
382-
`lune run batch-process process-keys DS_DELETION_JUNE17 -c <config filepath>.json`
384+
`lune run batch-process process-keys DS_Deletion -c <config filepath>.json`
383385

384386
On a related note, bulk Data Store deletion can be achieved by integrating the Deletion API with the batch processor. Please take caution that you are only deleting data stores that you are no longer
385387
using.
@@ -416,7 +418,7 @@ end
416418

417419
2. **Create the Configuration File** (or provide arguments on the command line)
418420
3. **Run the `process-data-stores` command to kick off the deletion:** e.g.
419-
`lune run batch-process process-data-stores DS_DELETION_JUNE17 -c <config filepath>.json`
421+
`lune run batch-process process-data-stores DS_Deletion -c <config filepath>.json`
420422

421423
## **9\. Example Use Case: Data Migrations**
422424

@@ -459,7 +461,7 @@ to meet this exact use case in the `examples` folder in the tool.
459461
3. Update the provided `ds2-config.json` file with your preferred callback (`ds2-migrate[-delete[-all]].luau`), `universeId`, `placeId`, and the DataStore2 prefix. The DataStore2 prefix is the name of the key / master key of your data store, followed by a ‘/’. For example, if you have a master key called `DATA`, then the prefix will be `DATA/`. We recommend verifying you have the correct prefix by looking for data stores with the pattern `<prefix><user id>` in Data Stores Manager.
460462
4. (Optional) If you are using a custom migration scope in the [**DataStore2 Migration Tool**](https://create.roblox.com/store/asset/82521207271039/BETA-DataStore2-Migration-Tool?keyword=datastore2&pageNumber=1&pagePosition=0), edit the chosen callback script and add the scope as the value of `MIGRATED_DS_SCOPE`.
461463
5. Run the `process-data-stores` command, e.g.
462-
`lune run batch-process process-data-stores DS2_Migration_June17 -c examples/ds2-config.json`
464+
`lune run batch-process process-data-stores DS2_Migration -c examples/ds2-config.json`
463465

464466
### **9.3. Specific Example: Generic Berezaa Method Migration**
465467

src/main.luau

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ local Resume = require('./commands/resume')
2222
local Types = require('./shared/types')
2323

2424
-- Constants
25-
local MAX_PROCESS_NAME_LENGTH = 50
25+
local MAX_PROCESS_NAME_LENGTH = 18
2626

2727
--[[
2828
Main entry point for the batch processor.

0 commit comments

Comments
 (0)