I decided to keep this first PR focused solely on restructuring the code to our ideal architecture, while making as few real code changes as possible. Most of the code from main.go was copied as-is to step.go, with some exceptions to handle the breakout into the new methods in main.go (ProcessConfig, InstallDependencies, Run, and ExportOutput).
I would still like to spend some time adding some unit tests and doing some other cleanup before releasing this, which I'll work on next.
Nice, this looks like a great step in the right direction.
I'd imagine a bunch of the step code can be cleaned up w/ V2.
Then we can start adding some unit tests etc.
Shoutout to @shams-ahmed, @matrangam, and others on the team for the guidance here π
Checklist
step.yml
andREADME.md
is updated with the changes (if needed)Version
Requires a MAJOR/MINOR/PATCH version update
Context
Updates the step to our "ideal step architecture", with minimal code changes.
Changes
main.go
intostep.go
.main.go
as a simple interface to the rest of the step's logic.Investigation Details
I used the steps-xcode-build-for-test step as a guide when building out these changes.
Decisions
I decided to keep this first PR focused solely on restructuring the code to our ideal architecture, while making as few real code changes as possible. Most of the code from
main.go
was copied as-is tostep.go
, with some exceptions to handle the breakout into the new methods inmain.go
(ProcessConfig
,InstallDependencies
,Run
, andExportOutput
).I would still like to spend some time adding some unit tests and doing some other cleanup before releasing this, which I'll work on next.