# SDP Release Process Overview ## Introduction This document describes the process used to release the Server Deployment Package (SDP). This is intended for staff developing the SDP. ## Preparation A dedicated SDP workspace should be used for releasing the SDP, separate from any you might use for SDP development. This dedicated release workspace should not contain any cruft files such as editor temp files. The release process mechanisms prevents known-cruft files from being added such as `*~` files and `.DS_Store` files on Mac. Using a clean dedicated release workspace guarantees no local excess files can sneak into the packaging process. ## Procedure ### Step 1: Plan! Use [this JIRA Project](https://perforce.atlassian.net/jira/software/c/projects/SDP/issues) to plan your work. This JIRA instance is only accessible with Perforce corporate SSO. The SDP product owner determines what the release will be. For example **2024.2** would be the **SDP 2024.2, GA Release**, while **2024.2.1** would be **SDP 2024.2 Patch 1**. The SDP shares the same major version as Helix Core (e.g. 2024.1). Versions in JIRA use the major version number, and append an integer as the patch identifier. The patch number is omitted for the GA release, and increments starting from 1 for each patch after a major release. While SDP major releases are bound to the P4D release schedule, SDP patches release on an independent schedule. During planning, create JIRA `Fix version` identifiers, such as 2024.2, 2024.2.1, 2025.1, etc. Also, create JIRA search filters for each `Fix version`, e.g. `SDP 2024.2`. There will also be a fixed `SDP To Do` filter with all open jobs used during planning. Output: The output of this step is a set of JIRA issues associated with `Fix versions`. ### Step 2: Develop! Develop and test changes in dev branch. This will occur over time. When an issue is marked as complete, do the following in JIRA to get it included in the Release Notes: * Set the `Fix versions` JIRA issue field value to the next release, e.g. `2024.2`. * Update the `P4Blog` field of the JIRA issue with an indication of what change addressed the issue. This can be a review URL from The Workshop, e.g. https://swarm.workshop.perforce.com/reviews/29811, or could also be the URL for the changelist in the SDP dev branch where the fix was made. Output: The output of this step is an improved software product and information needed to create release notes for the release. ### Step 3: Target New P4D in SDP Regression Test Suite (Major Releases Only) This step applies to major releases only; skip this for patch releases. Update the SDP regression test suite to ensure that it references the new Helix Core release. Here is a sample of the required change: ``` Change 29229 by tom_tyler@tom_tyler.P4MBPro4.test_sdp_dev on 2022/12/04 04:27:34 Accounted for change to default Helix Server version. Affected files ... ... //guest/perforce_software/sdp/dev/Server/test/test_Upgrade.py#17 edit Differences ... ==== //guest/perforce_software/sdp/dev/Server/test/test_Upgrade.py#17 (text+x) ==== 95c95 < parser.add_argument('--to-version', default="23.2") --- > parser.add_argument('--to-version', default="24.1") ``` This code change might possibly break the regression. It is important to re-verify that the regression test suite is still successful after this change, adapting as needed. ### Step 4: Verify SDP Regression Tests Verify that both SDP regression test suites are successful. The first test suite is the Docker-based test suite: The [SDP regression test suite](https://workshop-jenkins.das.perforce.com:8080/jobs/sdp-dev) is only accessible from the Perforce corporate VPN. The second test suite is the Battle School Workshop test suite, which operates in a dedicated Battle School Workshop Lab Environment. Tests are started by doing `lab qa` in a specially prepared lab environment, and following the instructions. The tests in this test suite are defined in `cli_tests.cfg` and `scripted_tests.cfg` in the `test/bsw` folder of the SDP, and are initiated with the `run_all_tests.sh` script. More info is available in this directory. Output: The output of this step is confidence we're not regressing. ### Step 5: Determine Release Type Determine if the SDP release is to be Major, Patch, or Doc Only. Since the 2021.2 release of P4D, SDP major releases have been tied to the P4D release schedule, **with SDP releases occurring approximately 10-15 business days after P4D releases**. Other releases will be Patch releases if there are any functionality changes, or Doc Only releases, where changes since the last release affect only documentation. The SDP documentation is key to its value, worth doing patch updates including only documentation changes. ### Step 6: Update Default P4D Version (Major Releases Only) This step applies to major releases only; skip this for patch releases. Modify the script `//guest/perforce_software/sdp/dev/helix_binaries/get_helix_binaries.sh` as follows: * Change the `Version=` value, incrementing the 3rd digit by one. So if the current value is `1.3.9`, increment to `1.3.10`. * Change the `DefaultHelixVersion` value to match the current P4D GA release version with a value like `r24.2`. The binaries for this release should be accessible under https://ftp.perforce.com/perforce/r24.2 (replacing `r24.2` with the new value). ### Step 7: Update P4*.json release list files (Major Releases Only This step applies to major releases only; skip this for patch releases. Edit the *P4*.json release list files used by `get_helix_binaries.sh`. Starting from the root of your SDP workspace, do: ``` cd dev/helix_binaries p4 edit P4*.json for jf in P4 P4D P4Broker P4Proxy; do curl -O "https://updates.perforce.com/static/${jf}/${jf}.json" p4 diff "${jf}.json" done ``` Verify the contents of the downloaded *.json files contain valid JSON content. Then submit: ``` p4 submit -d "Updated JSON files" "P4*.json" ``` **REMINDER**: The `DefaultHelixVersion` changes *only* for GA releases, not patches. Also, the P4*.json files need only be updated for major releases. ### Step 8: Update Release Notes Update the doc/ReleaseNotes.adoc file, specifically the **Change History** section, by adding a new section titled something like **SDP 2024.1 Patch 1** to include the JIRA issues fixed since the last SDP release or patch. Run a JIRA report of SDP issues with the target `Fix versions`, e.g. `2024.1.1`, and ensure all issues listed in the report are considered for inclusion in the release notes. We don't need a JIRA issue for every change. Create JIRA issues to cover the essentials of what changed. Folks who want the gory details can look at changelists, but folks looking only at the release notes should get a useful summary of what's new in this release or patch, and if appropriate, what to be aware of when taking this release. Some JIRA issues may be excluded from the public facing release notes if they're not helpful or relevant in helping a customer understand what changed. This JIRA management work in reality is done during the development, mixed with work from Steps 1 and 2 above. At release time, this check should be a formality to ensure release notes are complete. ### Step 9: Load Release Tools Load the latest SDP tools shell environment. Change to the dir in your SDP workspace corresponding to `//guest/perforce_software/sdp/tools`, and do `p4 -s sync` followed by `source ./env.sh` in that directory. ### Step 10: Merge Down Ensure the `dev` branch is updated from main. This ensures any hot fixes that my have been made directly in `main` branch are considered for incorporation in the formal release. ``` $ p4 merge -n -b perforce_software-sdp-dev All revision(s) already integrated. ``` If there is anything to merge, take care of it in your regular SDP development workspace, not the release workspace. If needed, file new jobs and associate them with changes. Upon completion of any needed merge work. Note: Any hot fixes should generally be merged immediately after the hot fix, so that this check is just a formality. No actual merge work is expected during the release process. If merge work is required, regression test suites will need to be re-verified. ### Step 11: Update Doc Versions (Major Releases Only) This step applies to major releases only; skip this for patch releases. Update AsciiDoc `revnumber` and `revdate`. In all *.adoc files, verify that the `:revnumber:` and `:revdate:` tags in the file refer to the correct SDP release version and date the file was last modified -- updating it to the current date. The *.adoc files appear in the `dev/doc` folder as well as the `Unsupported/dev/doc` folder; ensure both are updated. The fields look something like this example in each *.adoc file: ``` :revnumber: v2024.2 :revdate: 2024-12-20 ``` This can be done like so: ``` Workspace=$(p4 set -q P4CLIENT|cut -d= -f2) p4 --field Description="Updated revnumber and date for release." --field Jobs= --field Files= change -o | p4 change -i CL=$(p4 -ztag -F %change% changes -s pending -c $Workspace -m1) { for df in $(p4 -ztag -F %depotFile% grep -e :revnumber: "//guest/perforce_software/sdp/dev/doc/*.adoc" "//guest/perforce_software/sdp/dev/Unsupported/doc/*.adoc"); do f="$(p4 -ztag -F %path% where $df)"; echo -e "\\nFile=$f"; p4 edit -c $CL "$f"; sed -i -E -e "s|^:revnumber:.*|:revnumber: v2024.2|g" -e "s|^:revdate:.*|:revdate: 2024-12-20|g" "$f"; p4 diff "$f"; done; p4 describe -s $CL; } 2>&1 | tee /tmp/docup.log ``` Review documents for any outdated references or content. At this point all *.adoc files will be opened in the default changelist. Generate a pending changelist: ``` p4 --field Description="Updated rev{number,date} fields in adoc files for release." change -o | p4 change -i ``` Review the generated pending changelist, and submit. Ensure before submitting that the changelist contains only the *.adoc files. ``` p4 -s submit -c $CL ``` ### Step 12: Update TAG Refs in SDP Upgrade Script This step applies to any release (major or patch) in which changes to the `p4_vars.template` or `instance_vars.template` files were made. Skip this for patch releases in which no changes to templates were made. To verify whether changes are were made to the SDP Environment File since the last release or patch, do: ``` LastReleaseCL=$(p4 print -q //guest/perforce_software/sdp/main/Version|cut -d '/' -f 4|cut -d ' ' -f 1) p4 changes //guest/perforce_software/sdp/dev/Server/Unix/p4/common/config/p4_vars.template@$LastReleaseCL,@now p4 changes //guest/perforce_software/sdp/dev/Server/Unix/p4/common/config/instance_vars.template@$LastReleaseCL,@now ``` If no changes were made, skip to the next step. Otherwise, modify the script `//guest/perforce_software/sdp/dev/Server/Unix/p4/common/sdp_upgrade/sdp_upgrade.sh` as follows: * Change the `Version=` value, incrementing the 3rd digit by one. So if the current value is `1.6.4`, increment to `1.6.5`. * Search the file for `TAG:` comments. * Update `SDPEnvFileNewFormatVersion` if the format of the SDP Environment File `p4_vars` changed since the last release or patch. Check with * Update `SDPInstanceCfgFileNewFormatVersion` if the template for the Instance Config File changed since the last release or patch. * Update the `SDPTargetMajorVersion` to the new version about to be released. ### Step 13: Generate Script Docs Ensure generated documentation is current. Starting from the root of your SDP workspace, do: ``` cd dev/doc/gen ./gen_script_man_pages.sh -submit ``` Observe the output. It may or may not create a new changelist in `//guest/perforce_software/sdp/dev/doc/gen/...`, depending on whether the various scripts have changed since docs were last generated for them. This script runs scripts with the `-man` option and stores that in a file, which is then included in `SDP_Guide.Unix.adoc`. ### Step 14: Generate HTML and PDF Docs NOTE: For the following to work, you will need some utilities, including `asciidoc`, `asciidoc-pdf`, and `markdown`. Generate HTML and PDF files from the AsciiDoc (`*.adoc`) and Markdown files (`*.md`). Starting from the root of your SDP workspace, do: ``` cd dev/doc make clean all p4 rec cd ../Unsupported/doc make clean all p4 rec p4 --field Description="Regenerated docs for release." change -o | p4 change -i ``` Review the generated pending changelist. Ensure before submitting that the changelist contains only expected files, generally *.html and *.pdf files. If all is well the then use the command below with the appropriate changelist number ``` p4 submit -c ##### ``` ### Step 15: Update SDP Version File Change to the directory in your SDP workspace corresponding to `//guest/perforce_software/sdp/tools`, and use a script to determine the release changelist, which will be the latest changelist in the dev branch. ``` cd ../../../tools ./preview_changes_and_update_version.sh 2>&1 | tee /tmp/preview.log ``` This script will prompt for the major release version, e.g. `2024.2`. It will also display the change is proposes to make to the Version file, something like this: ``` Updating /Users/ttyler/re/sdp/dev/Version file. //guest/perforce_software/sdp/dev/Version#152 - opened for edit ==== //guest/perforce_software/sdp/dev/Version#152 - /Users/ttyler/re/sdp/dev/Version ==== 1c1 < Rev. SDP/MultiArch/2024.1/30924 (2024/11/21). --- > Rev. SDP/MultiArch/2024.2/31075 (2024/12/20). ``` Review the `/tmp/preview.log` to make sure no significant changes were excluded from the release notes. If the diff of the Version file looks reasonable, proceed with updating the Release Notes (ReleaseNotes.adoc) file one more time, injecting the just-generated changelist number and content of the new Version file. The **Change History** section should look have a release indicator something like this: ``` === SDP 2024.2 GA: Released: Rev. SDP/MultiArch/2024.2/31075 (2024/12/20). Jobs Fixed since change 30924 up to 31075 (B=Bug, D=Doc, F=Feature): ``` Then checkout and regenerate the ReleaseNotes.{html,pdf} files. At this there should be a changelist with these files checked out: ``` $ ttyler:/Users/ttyler/re/sdp/dev/doc p4 opened //guest/perforce_software/sdp/dev/Version#152 - edit default change (text) //guest/perforce_software/sdp/dev/doc/ReleaseNotes.adoc#104 - edit default change (text) //guest/perforce_software/sdp/dev/doc/ReleaseNotes.html#86 - edit default change (text) //guest/perforce_software/sdp/dev/doc/ReleaseNotes.pdf#64 - edit default change (binary) ``` Then submit: ``` p4 submit -d "Updated Version for release." ``` ### Step 16: Copy Up Push the files to main. Change to the `dev` branch directory in your workspace. Run `mdcu.sh` (Merge Down/Copy Up) script, which takes no arguments and is not interactive. That script creates a pending changelist with the Copy Up main. Massage the generated pending changelist description if desired. **WARNING FOR PARTIAL RELEASES**: If this is to be a partial release, revert any files that are not ready to be released from the main branch. Also be sure the reverted files correlate to any jobs removed for a partial release. Next, submit the generated pending changelist manually. ### Step 17: Package After running this script, run `bash package_downloads.sh`. This puts tar and zip files into the downloads folder. Submit the generated changelist manually.