Problem:
- externalize strings of file into a seprate file
- each time a merge is made
- a request needs to be made Automatically
- create a seprate PR
- pulls all strings from the commited files
- create random variables names for each of these strings
- push them in a seprate predefine file
- replace the strings on the commited files with the generated random variables that are on the predefine file
Solution:
- when the Merge Made, there would be a service that is listenning to the merging event,
- so when this merge happen it trigger a call to an API
- What the API does is
-
as its being triggered from the merge event, this means that it has access to the commited files
-
with the on hand, what we need right now is to
- locate all strings on these files
- for each string found
- create a random variable
- remove the string from the file
- put the random variable and its respected value into the predfined file
- replace this removed string with the created random variable
- import the predefined file into the commited files that you replaced its strings,
- always import at the start of the file no need to do any algorthim for that
- the predefined file will be on the root folder of the project, so it should be simple to locate the file path based on the commited file path
-
after all strings are done,
-
a bash script that
- create branch,
original branch + SSA
which refers to strings sepration automation - create another automate PR, with the
original PR name + string-seprated-automated
- something that define that this PR is automated and the job of this automation
- merge it or maybe some review needs to be done first, this is a choice based on the needs
- create branch,
-
the return of that API might be maybe an object with status check of each of these process, to make sure that it works good, or something needs to be redone,
-