Release Process:
This entry describes the steps necessary to make a new ODOP "release".
Specifically, this is the process to publish the current development version and its documentation to Heroku.
Ideally, any system downtime affecting the production system should be announced in advance via messageOfTheDay.md
Effective with v4.2, documentation (Help, About, design, procedures, etc. but not messageOfTheDay) is hosted on Heroku.
The build process includes a Harp compile to create html files for end-user viewing.
Full-text indexing is done at the same time.
The html files should be referenced via the CNAME: odop.springdesignsoftware.org/docs and carry the .html suffix as in:
Document structure.
Still maintained on GitHub Pages, messageOfTheDay can be updated independently of the release process.
A. Initial steps preparing for release
- Confirm that the steps in Prepare for Development been executed previously.
- Confirm that the steps in Post Development been executed recently.
- Verify GitHub Milestone issues are completed. Ask:
"Have we done everything on our milestone list?"
"Is there anything else we need to do?"
"Are we ready for release?"
- Make sure your development environment is on branch master.
- If this release has no migrate requirement, initialState impact or environment variable changes,
skip forward to Run Test Automation.
To confirm,
compare the current master branch against the previous released commit tag branch
and check if any of the client/src/designtypes/.../initialState.js files have changed.
- Confirm offsets.js and symbol_table_offsets.js have been updated as part of migrate.js changes and are both updated to be consistent. Do this by copying from View : Offsets and View : SymbolTableOffsets and paste into offsets.js and symbol_table_offsets.js for all design-types that were changed.
- For all design types impacted by migrate, confirm that the version numbers set in the initialState.js files are consistent with the version numbers set in the corresponding migrate.js.
- If the database does not exist or is brand new and empty, then see Procedures for creating a new JAWSDB
to create and format the database tables using the create.sql file.
Do this to development, test, staging and/or production databases as appropriate.
See Heroku Dashboard Resources tab for JAWS DB.
The database names are summarized in Procedures for creating a new JAWSDB.
- Automated verification and load.sql generation (all five design types): This handles both initialState/migration export comparison and SQL generation. With server and client npm dependencies installed, run
npm run generate-startup-sql from the repository root. No running server, database connection, or admin login is required.
- The script exercises the actual File Open, Execute, and File Export components in jsdom. For each design type, it compares Sorted Export of Startup and Startup_Metric created from initialState by the mk*Startups macro with regular Export of migrated saved startup records. All ten comparisons must pass before any load.sql file is written. Every field, value, and array order must match; only JSON property order is ignored.
- Saved records come from the SQL files in Git ref
master by default, supplied through mocked API responses. No live database is accessed. To verify against a previous release or another commit, set ODOP_STARTUP_BASELINE_REF to that Git ref before running the command. Choose a baseline that still contains the older startup records to exercise migration; newly regenerated records do not verify the older migration path.
- Review the 20 exported JSON files and comparison report in the unique temporary directory printed by the script. If verification fails, resolve the differences and rerun; the existing SQL files remain unchanged.
- After verification passes, the script executes every step of all five mk*Startups macros using the application's Redux dispatcher and calculations, then writes all five
designtypes/**/load.sql files (16 designs). Each row omits id, sets user=NULL, and includes literal created_at and updated_at timestamps captured when the script starts (local system time), shared by all designs. The SQL already has a separate line for each VALUES row; no manual SQL cleanup is required.
- Run
npm run check-startup-sql to repeat the export comparisons and check SQL freshness without writing SQL. This preserves saved timestamps during comparison. Review and commit the generated files and any migration repairs, then skip the two manual alternatives below and continue with loading the development database.
- Manual verification alternative: Start server and client under your development environment, then verify initial_state and migrate match: Repeat the following steps for each design type (Piston-Cylinder, Solid, Spring/Compression, Spring/Extension, and Spring/Torsion) with an impacted initialState or initialSystemControls.
- For each design type that has an impacted Initial State
- Do a File > Open > Load Initial State. Run Action > Execute > mk[x] script where x is Startups, Startup & Startup_Metric (ignore all the other mk files), and Close to created each [x] file. Do a File > Sorted Export and rename into the [mk_x] JSON file.
- Separately do a File > Open > Startup which should migrate it followed by a File : Export and rename into a "Migrated_x" JSON file.
- Compare the two JSON files to verify that initial state and migration operate exactly the same. If they don't match then repair them until they do or the changes are as intended.
- Manual SQL generation alternative: Create load.sql files: Repeat the following steps for each design type (Piston-Cylinder, Solid, Spring/Compression, Spring/Extension, and Spring/Torsion) with an impacted initialState or initialSystemControls.
- Do a File > Open > Load Initial State for each design type that has an impacted Initial State. It is not necessary to Load Initial Metric State, because each mk_ script loads the correct initial state file (US or Metric) when it runs. Do this FOR ALL mk* files: Run Action > Execute > mk[x] script and Close the script to created each [x] file. Do a File > Save into the [x] file.
- Using MySqlDump command run the
scripts/dump_db_startup_files.sh script to dump all newly created design files into their respective load.sql files. You might need to set a different Userid (token?) inside the WHERE clause for the Admin User who saved this file in the previous step.
- Finally, manually edit and add carriage returns before each inserted VALUES section, and delete the 'id' field name and 'id' field value (it should be first in each record),and set the user field to NULL.
- Commit these changes. The script to load these changes will be run in a later step.
- Either modify the script for the development database and
run the configured ./scripts/load_db_startup_files.sh script
or
manually run all affected load.sql files to create startup files for each design type in the develoment database.
This sets the User field to NULL so that these files can be accessed by all development database users.
Optionally load the Staging database with these files too.
- If there are environment variable changes, update Server's .env and Client's .env with the following for development (localhost). NOTE: No entry for Server's .env or Client's .env is needed for JS_RUNTIME_TARGET_BUNDLE for development (localhost). Assume NODE_ENV="development" for software development environment, or "test" for test case execution environment.
- For server
- NODE_ENV=development|test|staging|production
- JAWSDB_URL
- JAWSDB_TEST_URL
- TEST_USERID
- TEST_PASSWORD
- FRONT_URL
- MYSQL_HOST
- MYSQL_PORT
- MYSQL_DATABASE
- MYSQL_USER
- MYSQL_PASSWORD
- MYSQL_TEST_HOST
- MYSQL_TEST_PORT
- MYSQL_TEST_DATABASE
- MYSQL_TEST_USER
- MYSQL_TEST_PASSWORD
- SMTP_HOST
- SMTP_PORT
- SMTP_USER
- SMTP_PASS
- SESSION_SECRET
- ENABLE_DB=true
- For client
- REACT_APP_NODE_ENV=development|test|staging|production
- REACT_APP_DESIGN_TYPES=["Piston-Cylinder","Solid","Spring/Compression","Spring/Extension","Spring/Torsion"]
- REACT_APP_DESIGN_TYPE=Spring/Compression
- REACT_APP_DESIGN_NAME=Startup
- REACT_APP_DESIGN_UNITS=US
- REACT_APP_DESIGN_VIEW=Advanced
- REACT_APP_SESSION_REFRESH=3600
- REACT_APP_ENABLE_DB=true
- REACT_APP_ENABLE_ANALYTICS=true
- REACT_APP_GA_ID='G-XXXXXXXXXX'
- REACT_APP_GA_ADS_ID='AW-XXXXXXXXX'
- REACT_APP_GA_CONVERSION_EVENT='AW-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
- REACT_APP_ENABLE_CAD_VIEW_MODEL=true
- Do a pull or push to get latest version on all systems.
- Confirm that test automation in Post Development was recently executed.
- If necessary, shutdown server and client under your development environment before running tests.
- Update client/src/version.js file to Major.Minor.Patch (for example: 2.3.1). Remove 'dev' suffix. Optionally use 'rc1', 'rc2', etc.
- Commit with message "Update version.js to Major.Minor.Patch" and push to origin.
- Pull to get latest version on all systems.
- If necessary, restart server then client under your development environment.
- Bring up on Windows under Microsoft Chromium Edge and verify Help : About Software Version is as expected (Major.Minor.Patch).
Bring up on Windows and Mac OS X under Google Chrome and verify Help : About Software Version is as expected.
B. DO first for STAGING and then do again for PRODUCTION environments
- If not logged into Heroku, go to the Heroku Website and log in.
- If operating on the production system (ignore for staging), check for active users on the production system; put the production system in maintenance mode.
Maintenance mode may be enabled in the Heroku console settings tab or from the command line with:
heroku maintenance:on -a odop
- If no changes to dynamic runtime configuration variables skip forward to Database Stuff.
- For handling dynamic runtime configuration variables in Heroku only:
From Dashboard, expand "odop" for production or "odop-staging" for the staging system. Go to settings/Config Vars. Click "Reveal Config Vars".
Update Heroku Configuration Variables JS_RUNTIME_TARGET_BUNDLE to "/app/client/build/static/js/*.js" for staging, or production.
- Update Heroku Configuration Variables with the following for staging (odop-staging), or production (odop).
- For server
- NODE_ENV=development|test|staging|production
- JAWSDB_URL
- JAWSDB_TEST_URL
- TEST_USERID
- TEST_PASSWORD
- FRONT_URL
- MYSQL_HOST
- MYSQL_PORT
- MYSQL_DATABASE
- MYSQL_USER
- MYSQ\L_PASSWORD
- MYSQL_TEST_HOST
- MYSQL_TEST_PORT
- MYSQL_TEST_DATABASE
- MYSQL_TEST_USER
- MYSQL_TEST_PASSWORD
- SMTP_HOST
- SMTP_PORT
- SMTP_USER
- SMTP_PASS
- SESSION_SECRET
- ENABLE_DB=true
- For client
- REACT_APP_NODE_ENV=development|test|staging|production
- REACT_APP_DESIGN_TYPES=["Piston-Cylinder","Solid","Spring/Compression","Spring/Extension","Spring/Torsion"]
- REACT_APP_DESIGN_TYPE=Spring/Compression
- REACT_APP_DESIGN_NAME=Startup
- REACT_APP_DESIGN_UNITS=US
- REACT_APP_DESIGN_VIEW=Advanced
- REACT_APP_SESSION_REFRESH=3600
- REACT_APP_ENABLE_DB=true
- REACT_APP_ENABLE_ANALYTICS=true
- REACT_APP_GA_ID='G-XXXXXXXXXX'
- REACT_APP_GA_ADS_ID='AW-XXXXXXXXX'
- REACT_APP_GA_CONVERSION_EVENT='AW-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
- REACT_APP_ENABLE_CAD_VIEW_MODEL=true
- Update Heroku Buildpack for staging (odop-staging), or production (odop).
Buildpack configuration is on Heroku Settings tab.
- Database Stuff If this release has no database impact, skip forward to Publish to Heroku.
- If the database does not exist or is brand new and empty, then see Procedures for creating a new JAWSDB
to create and format the database tables using the create.sql file.
Do this for staging and/or production databases as appropriate.
See the above link for the easier-to-read table of database names.
- Optionally back up staging database. Back up the production database.
Use the ./scripts/dump_db.* script or batch file.
For background on backup provided by JAWSDB see: Heroku docs
- Check the size of the production database as compared to capacity limits
(1024MB for production paid kitefin-manifold-mysql; 5MB for JAWSDB free plan).
Use the ./scripts/list_db_size.* script or batch file.
For details, see the first FAQ question at: https://devcenter.heroku.com/articles/jawsdb#faq
If appropriate, dump and archive to off-line storage and re-initialize the usage_log table.
- If the database already exists but no entries exist or must be recreated, then either
run the ./scripts/load_db_startup_files.* script or batch file
or
manually run all affected load.sql files to create startup files for each design type in the affected database (for example, do this for Staging and Production).
- Delete any old, invalid or development-only designs if necessary.
- Run the production build in a test environment to confirm that things are synchronized
with the Heroku build environment and assure that the build process goes smoothly during the actual release.
One possibility is to build into the staging system with the Heroku environment variables set to "production".
- Set NODE_ENV to "production"
- Set REACT_APP_NODE_ENV to "production"
- Release to staging via
git push heroku-staging master
- Verify that it is production by starting
https://odop-staging.herokuapp.com/ and checking if "Load Initial State" is not in File Open modal.
- Afterwards reset REACT_APP_NODE_ENV to "staging"
- Leave NODE_ENV to "production"
- Publish to Heroku If production, update messageOfTheDay.md to announce availability of the new version.
To do this do the following: Create issue branch, update MOTD file, check-in change to branch and iterate if necessary, then when all is ready merge branch into master.
Note: Merging will publish the MOTD externally/publicly.
- Do a pull as required to get latest version on all systems.
- If not logged into Heroku, login in using the command line "heroku login" which in turn brings up the Heroku website login page in your browser.
- Shutdown server and client under your development environment.
- In your git/odop directory push to Heroku using the command line:
git push heroku-staging master
or
git push heroku master
Verify no error messages during build on heroku.
Note 1: This step may fail if the previous release contains patches that are not included in the new release.
You can either move those patches into the current release or issue the git push command with a --force option.
Note 2: to push a non-master branch, confirm that is the current branch with:
git status
then
git push heroku[-staging] +HEAD:master
- If maintenance mode was previously enabled, disable maintenance mode:
heroku maintenance:off -a odop
- Confirm that the http://odop-staging.springdesignsoftware.org or http://odop.springdesignsoftware.org website is operational and that version Major.Minor.Patch displays.
- Confirm that the https://odop.springdesignsoftware.org/docs website is operational and that documentation displays.
C. Post Release Steps
- Do a pull as required to get latest version on all systems.
- Create Major.Minor.Patch tag (for example, 3.2.1).
Commit "Release Major.Minor.Patch" and push to origin.
- In Eclipse do a pull, Team > Show in History and verify tag is Major.Minor.Patch (for example, 2.3.1).
- Create a "master-Major.Minor.Patch" branch, commit and push to origin.
- Switch back in the "master" branch.
- Update client/src/version.js file to next Major.Minor.Patch followed by suffix 'dev' (for example: 2.4dev).
- Commit with message "Update version.js to Major.Minor.Patchdev" and push to origin.
- In GitHub, mark Milestone Major.Minor.Patch closed.
D. FUTURES
- Looking to the next release, review the steps in Prepare for Development.