Repository navigation
Fix remaining notarization issues from #8486 - #8494
Conversation
WalkthroughThis pull request enhances macOS CI/CD security and notarization workflows by introducing TEAM_ID environment variable support throughout the notarization process, adding timestamp flags to code signing operations, extending keychain import configurations, implementing environment variable redaction for sensitive data, and adding post-install signing for third-party components in the package build. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~35 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@jpfeuffer sometime during the package step, the build hangs. I assume there is some request for interaction from the user, but I'm unfamiliar as to what. Can you opine on the issue? |
|
Hmm I think a few minutes might be expected for notarization. Do you have a link? |
|
Here's it doing it in the nightly last night: https://github.com/OpenMS/OpenMS/actions/runs/20201730812/job/57994091684 |
|
and it's currently waited for ~30 minutes on https://github.com/OpenMS/OpenMS/actions/runs/20208035879/job/58009592384 |
Add build.keychain to the list of keychains for code signing.
|
Maybe it's the logo that I included back?? I don't think I changed much else in packaging. |
The devil-machine suggested that it's an issue with the the keychain not getting added to the default keychain search list. I added a line to explicitly do that, so lets see if it works. |
|
Hmm maybe. But I don't think I changed the logic there. I just added a new entry or something. |
|
CAnnot reproduce locally. Takes two minutes. Also the logo is there. |
|
For what its worth, this is the same behaviour that I saw before I was properly importing the cert last year, see 066d9eb which fixed it. No idea why it's behaving this way now again. |
|
Feels like CMake and ninja are just too stupid and check every file in the build tree or something when using cpack as a cmake target. Then call cpack. Globbing directories also takes quite some time on my mac. I wonder if the disk on GitHub is just so slow that this gets infinitely slower. |
|
I am saying this because the build seems to be stuck on Re-checking globbed directories... |
|
I introduced the dist target to make sure that all the important targets are built before calling cpack and also signed_dist to include the signing into cmake. I guess these days when everything is on CI, we should just do ninja install and cpack from outside of cmake. |
Yeah, but that was what it said when the actual issue was missing certs last time. |
|
Ok you can check what I changed in the certs I think I just added a print statement and an additional program (product build) that is allowed to open/use the cert. |
|
@copilot in the package step. Instead of executing everything in the completely obfuscated ctest/cmake script, just reconfigure the project with the given env vars passed as -D flags. Keep the old step commented out for future use or reversal. |
|
@jpfeuffer I've opened a new pull request, #8498, to work on those changes. Once the pull request is ready, I'll request review from you. |
TEAM_ID is now required even with only one team.
|
@poshul the notarization script does not pass team ID to the second call for logs. |
Fixed it now. Thats what I get for trying trying to do too many things at once. |
|
Hmm I was expecting that when I saw what it installs! We need to sign all the libs (and executables?) from the third parties, too. |
Co-authored-by: jpfeuffer <[email protected]>
Co-authored-by: jpfeuffer <[email protected]>
Co-authored-by: jpfeuffer <[email protected]>
…tables Sign thirdparty components for macOS notarization
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
cmake/MacOSX/notarize.sh (1)
90-91: Remove redundant pipefail setting.The
set -o pipefailat line 91 is redundant since it's already set globally at line 16. The comment suggests concern about subshells, but pipefail is inherited by subshells in bash.-# Ensure pipefail is set for this block in case of subshells -set -o pipefail
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
.github/workflows/openms_ci_matrix_full.yml(4 hunks)cmake/MacOSX/notarize.sh(5 hunks)cmake/package_dragndrop_dmg.cmake(1 hunks)cmake/package_mac_productbuild.cmake(1 hunks)tools/ci/capture-env.sh(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (14)
- GitHub Check: build-and-test (ubuntu-24.04, clang++, 17)
- GitHub Check: build-and-test (ubuntu-24.04-arm, g++, 13)
- GitHub Check: build-and-test (ubuntu-24.04, g++, 13)
- GitHub Check: build-and-test (macos-14, xcode, 15.4)
- GitHub Check: build-and-test (windows-2025, cl.exe, 14.44)
- GitHub Check: build-lnx
- GitHub Check: build-win
- GitHub Check: build-lnx-arm
- GitHub Check: build-macos-arm
- GitHub Check: build-and-test (macos-14, xcode, 15.4)
- GitHub Check: build-and-test (ubuntu-24.04, g++, 13)
- GitHub Check: build-and-test (ubuntu-24.04, clang++, 17)
- GitHub Check: build-and-test (ubuntu-24.04-arm, g++, 13)
- GitHub Check: build-and-test (windows-2025, cl.exe, 14.44)
🔇 Additional comments (12)
tools/ci/capture-env.sh (1)
78-84: LGTM: Sanitization improves security.The addition of sanitization (removing CR/LF and trailing whitespace) before using environment variable values is a good security practice that prevents potential injection issues or formatting problems in the CMake cache file.
cmake/package_dragndrop_dmg.cmake (1)
122-122: LGTM: Timestamp flag required for notarization.The addition of the
--timestampflag to both codesign commands is correct and necessary for macOS notarization. This ensures signatures remain valid even after the signing certificate expires by including a trusted timestamp from Apple's timestamp server.Also applies to: 130-130
.github/workflows/openms_ci_matrix_full.yml (4)
509-509: LGTM: Explicitly adds keychain to search list.This addresses the issue mentioned in PR comments where the keychain was not added to the default search list, which was causing notarization failures.
513-515: LGTM: Extends tool access for package signing.The addition of
productbuildandproductsignto the certificate import and partition list is correct for supporting .pkg installer signing. This ensures these tools can access the certificates without user interaction during the CI build.
526-526: LGTM: Increased verbosity aids debugging.The change from
-Vto-VVprovides more detailed output for the packaging step, which is helpful for diagnosing the notarization issues mentioned in the PR comments.
557-557: LGTM: TEAM_ID required for notarization.The addition of TEAM_ID and passing it to the notarization script is correct. The
--team-idparameter is required bynotarytoolwhen the Apple ID is associated with multiple developer teams, which prevents ambiguity during submission.Also applies to: 578-578
cmake/MacOSX/notarize.sh (6)
14-16: LGTM: Stricter error handling improves reliability.The addition of
set -eandset -o pipefailensures the script exits immediately on errors and properly detects failures in command pipelines, which is essential for CI/CD reliability.
31-31: LGTM: Flag-based approach improves clarity.The addition of the
IS_ZIPflag is a cleaner approach than pattern-matching the filename later in the script, making the stapling logic easier to understand.
62-63: LGTM: Simplified ZIP handling.The simplified approach for ZIP files (setting
BUNDLE_FILE="$BUNDLE_PKG"andIS_ZIP=true) is clearer and works well with the flag-based stapling logic.
92-97: LGTM: Team ID parameter required for notarization.The addition of
--team-id "$ASC_TEAMID"to the notarytool submit command is necessary when the Apple ID is associated with multiple developer teams, ensuring the notarization request is submitted to the correct team.
112-112: LGTM: Flag-based stapling check is clearer.Using
[[ "$IS_ZIP" = true ]]instead of pattern matching improves readability and is more maintainable, as it relies on the explicit flag set during file type detection.
146-150: LGTM: Team ID required for log retrieval.The addition of
--team-id "$ASC_TEAMID"to the notarytool log command is correct and necessary for retrieving notarization logs when the Apple ID is associated with multiple teams.
| ASC_TEAMID="$5" | ||
| LOG_FOLDER="${6:-.}" |
There was a problem hiding this comment.
Update usage message to reflect new parameter order.
The parameter order has been changed to add ASC_TEAMID as the 5th parameter, but the usage message (line 42) and the comment at line 5 still show the old signature without the team_id parameter.
Apply this diff to update both the header comment and the usage message:
-# Usage: notarize.sh <bundle_pkg> <bundle_id> <apple_id> <password_env_var> [log_folder]
+# Usage: notarize.sh <bundle_pkg> <bundle_id> <apple_id> <password_env_var> <team_id> [log_folder]
#
# Arguments:
# bundle_pkg - The package to notarize (.dmg, .pkg, .zip, or .app)
# bundle_id - The bundle identifier (e.g., de.openms)
# apple_id - Apple ID email for notarization
# password_env_var - Environment variable name containing app-specific password
+# team_id - Apple Developer Team ID (required when Apple ID is associated with multiple teams)
# log_folder - Optional: folder for log files (defaults to current directory)- echo "Usage: $0 <bundle_pkg> <bundle_id> <apple_id> <password_env_var> [log_folder]"
+ echo "Usage: $0 <bundle_pkg> <bundle_id> <apple_id> <password_env_var> <team_id> [log_folder]"Also applies to: 40-43
🤖 Prompt for AI Agents
In cmake/MacOSX/notarize.sh around lines 5 and 40-43, the script header comment
and the usage message still show the old parameter signature missing the newly
added ASC_TEAMID parameter; update the header comment at line 5 to include
ASC_TEAMID as the 5th parameter in the signature and modify the usage/help text
around lines 40-43 to list the parameters in the new order (adding ASC_TEAMID as
parameter 5 and shifting any subsequent descriptions accordingly) so the
displayed usage matches the actual argument parsing.
| ## Sign thirdparty components | ||
| foreach(component IN LISTS THIRDPARTY_COMPONENT_GROUP) | ||
| install(CODE " | ||
| if(EXISTS \${CMAKE_INSTALL_PREFIX}/${INSTALL_SHARE_DIR}/THIRDPARTY/${component}/) | ||
| execute_process(COMMAND find \${CMAKE_INSTALL_PREFIX}/${INSTALL_SHARE_DIR}/THIRDPARTY/${component}/ -type f -execdir codesign --force --options runtime -i de.openms.thirdparty.${component}.{} --sign \"${CPACK_BUNDLE_APPLE_CERT_APP}\" {} \\; OUTPUT_VARIABLE thirdparty_sign_out ERROR_VARIABLE thirdparty_sign_out) | ||
| message('\${thirdparty_sign_out}') | ||
| endif()" | ||
| COMPONENT ${component} | ||
| ) | ||
| endforeach() |
There was a problem hiding this comment.
Add --timestamp flag for consistency with other signing operations.
The codesign command for third-party components is missing the --timestamp flag, which was added to other signing operations in this PR (see cmake/package_dragndrop_dmg.cmake lines 122, 130). For consistency and to ensure notarization compatibility, this flag should be added.
Apply this diff:
- execute_process(COMMAND find \${CMAKE_INSTALL_PREFIX}/${INSTALL_SHARE_DIR}/THIRDPARTY/${component}/ -type f -execdir codesign --force --options runtime -i de.openms.thirdparty.${component}.{} --sign \"${CPACK_BUNDLE_APPLE_CERT_APP}\" {} \\; OUTPUT_VARIABLE thirdparty_sign_out ERROR_VARIABLE thirdparty_sign_out)
+ execute_process(COMMAND find \${CMAKE_INSTALL_PREFIX}/${INSTALL_SHARE_DIR}/THIRDPARTY/${component}/ -type f -execdir codesign --force --timestamp --options runtime -i de.openms.thirdparty.${component}.{} --sign \"${CPACK_BUNDLE_APPLE_CERT_APP}\" {} \\; OUTPUT_VARIABLE thirdparty_sign_out ERROR_VARIABLE thirdparty_sign_out)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ## Sign thirdparty components | |
| foreach(component IN LISTS THIRDPARTY_COMPONENT_GROUP) | |
| install(CODE " | |
| if(EXISTS \${CMAKE_INSTALL_PREFIX}/${INSTALL_SHARE_DIR}/THIRDPARTY/${component}/) | |
| execute_process(COMMAND find \${CMAKE_INSTALL_PREFIX}/${INSTALL_SHARE_DIR}/THIRDPARTY/${component}/ -type f -execdir codesign --force --options runtime -i de.openms.thirdparty.${component}.{} --sign \"${CPACK_BUNDLE_APPLE_CERT_APP}\" {} \\; OUTPUT_VARIABLE thirdparty_sign_out ERROR_VARIABLE thirdparty_sign_out) | |
| message('\${thirdparty_sign_out}') | |
| endif()" | |
| COMPONENT ${component} | |
| ) | |
| endforeach() | |
| ## Sign thirdparty components | |
| foreach(component IN LISTS THIRDPARTY_COMPONENT_GROUP) | |
| install(CODE " | |
| if(EXISTS \${CMAKE_INSTALL_PREFIX}/${INSTALL_SHARE_DIR}/THIRDPARTY/${component}/) | |
| execute_process(COMMAND find \${CMAKE_INSTALL_PREFIX}/${INSTALL_SHARE_DIR}/THIRDPARTY/${component}/ -type f -execdir codesign --force --timestamp --options runtime -i de.openms.thirdparty.${component}.{} --sign \"${CPACK_BUNDLE_APPLE_CERT_APP}\" {} \\; OUTPUT_VARIABLE thirdparty_sign_out ERROR_VARIABLE thirdparty_sign_out) | |
| message('\${thirdparty_sign_out}') | |
| endif()" | |
| COMPONENT ${component} | |
| ) | |
| endforeach() |
🤖 Prompt for AI Agents
In cmake/package_mac_productbuild.cmake around lines 127 to 136, the codesign
invocation used for signing thirdparty components is missing the --timestamp
flag; update the execute_process COMMAND string to add --timestamp to the
codesign options (so it matches other signing calls), ensuring the flag is
placed alongside --force --options runtime and before --sign, and preserve
existing quoting/escaping and OUTPUT_VARIABLE/ERROR_VARIABLE usage.
| if [ "$option_verbose" -eq 1 ]; then | ||
| echo "Found $var with value $val" | ||
| # Redact sensitive variables | ||
| case "$var" in | ||
| SIGNING_EMAIL|SIGNING_IDENTITY|CPACK_PRODUCTBUILD_IDENTITY_NAME) | ||
| # Mask: show first and last char, rest as asterisks (if length > 2) | ||
| len=${#val_sane} | ||
| if [ "$len" -le 2 ]; then | ||
| masked="$val_sane" | ||
| else | ||
| masked="${val_sane:0:1}***${val_sane: -1}" | ||
| fi | ||
| echo "Found $var with value $masked (redacted)" | ||
| ;; | ||
| *) | ||
| echo "Found $var with value $val_sane" | ||
| ;; | ||
| esac | ||
| fi | ||
|
|
||
| printf '%s:STRING=%s\n' "$var" "${val}" >>"$file" | ||
| printf '%s:STRING=%s\n' "$var" "$val_sane" >>"$file" |
There was a problem hiding this comment.
Consider improving redaction for very short sensitive values.
The current redaction logic doesn't adequately protect sensitive values with 2 or fewer characters, as they are displayed unmasked. Additionally, the fixed "***" mask doesn't scale with the actual string length, potentially leaking length information.
Consider this enhancement:
- len=${#val_sane}
- if [ "$len" -le 2 ]; then
- masked="$val_sane"
- else
- masked="${val_sane:0:1}***${val_sane: -1}"
- fi
+ len=${#val_sane}
+ if [ "$len" -le 1 ]; then
+ masked="*"
+ elif [ "$len" -eq 2 ]; then
+ masked="**"
+ else
+ # Show first char, mask middle proportionally, show last char
+ mask_len=$((len - 2))
+ mask_str=$(printf '%*s' "$mask_len" | tr ' ' '*')
+ masked="${val_sane:0:1}${mask_str}${val_sane: -1}"
+ fi📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if [ "$option_verbose" -eq 1 ]; then | |
| echo "Found $var with value $val" | |
| # Redact sensitive variables | |
| case "$var" in | |
| SIGNING_EMAIL|SIGNING_IDENTITY|CPACK_PRODUCTBUILD_IDENTITY_NAME) | |
| # Mask: show first and last char, rest as asterisks (if length > 2) | |
| len=${#val_sane} | |
| if [ "$len" -le 2 ]; then | |
| masked="$val_sane" | |
| else | |
| masked="${val_sane:0:1}***${val_sane: -1}" | |
| fi | |
| echo "Found $var with value $masked (redacted)" | |
| ;; | |
| *) | |
| echo "Found $var with value $val_sane" | |
| ;; | |
| esac | |
| fi | |
| printf '%s:STRING=%s\n' "$var" "${val}" >>"$file" | |
| printf '%s:STRING=%s\n' "$var" "$val_sane" >>"$file" | |
| if [ "$option_verbose" -eq 1 ]; then | |
| # Redact sensitive variables | |
| case "$var" in | |
| SIGNING_EMAIL|SIGNING_IDENTITY|CPACK_PRODUCTBUILD_IDENTITY_NAME) | |
| # Mask: show first and last char, rest as asterisks (if length > 2) | |
| len=${#val_sane} | |
| if [ "$len" -le 1 ]; then | |
| masked="*" | |
| elif [ "$len" -eq 2 ]; then | |
| masked="**" | |
| else | |
| # Show first char, mask middle proportionally, show last char | |
| mask_len=$((len - 2)) | |
| mask_str=$(printf '%*s' "$mask_len" | tr ' ' '*') | |
| masked="${val_sane:0:1}${mask_str}${val_sane: -1}" | |
| fi | |
| echo "Found $var with value $masked (redacted)" | |
| ;; | |
| *) | |
| echo "Found $var with value $val_sane" | |
| ;; | |
| esac | |
| fi | |
| printf '%s:STRING=%s\n' "$var" "$val_sane" >>"$file" |
…23 requirement The macOS line cited #8486, #8494 and #8527, which are notarization PRs; the references came along from a neighbouring bullet when the changelog was condensed. The minimum came from #8450 (14, with the Intel builds dropped), #9037 (15, together with C++23 and the macos-15 runners) and #10202 (15 for the wheels). The 3.6.0 changelog never said that OpenMS now needs C++23 (#9037). It now names the minimum compilers from cmake/min_compiler_versions.cmake. The dataframe page shows default_missing_values=None, the actual default of PeptideIdentificationList.to_df(), and what None stands for. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YC1T2K9HQEUk2kQMZqC8h7
…5 minimum (#10285) * [DOC,PYOPENMS] Update the user guide to the 3.6 API; macOS 15 minimum The user-guide examples still used the 3.5.0 API. Replayed against a 3.6 wheel built from develop (with the plot_spectrum fix of #10280), 20 of the 46 pages failed, 14 of which had passed on 3.5.0. Now 36 pass. Three still fail, two on bindings that are missing in 3.6 and one on #10260 item 4. Two need optional packages (datashader, massql). - Output arguments are return values: pickExperiment, getAllNames, digest, align, getDecompositions, getTag, ProtXMLFile.load, applyVariableModifications, getSpectrumAlignment, MassTraceDetection.run, ElutionPeakDetection.detectPeaks and filterByPeakWidth, and SimpleSearchEngineAlgorithm.search. - Strings are str: no .decode(), str keys and arguments instead of b"...", and element compositions print with str keys. char arguments such as PeptideEvidence.setAABefore take "R" and reject b"R". - Removed API: pyopenms.String, DPosition1 and the LogConfigHandler constructor. - Deprecated API: get_df() is now to_df(), and peptide_identifications_to_df() is now PeptideIdentificationList.to_df(). The dataframe page documents the to_df() signatures and the columns 3.6 returns. The merge example is left for #10260 item 4. - Examples that could not run anywhere: the FAQ snippet used an undefined exp, and memory_management and the detailed peptide search read files that exist only in a source checkout. They download their input now, like the other pages. - The stand-alone mass decomposition script imports pyopenms again, which also makes the prose's "line 8 and 9" right. The SpectrumLookup regex in ms_data is a raw string, which removes the invalid escape sequence warning. CHANGELOG: the minimum macOS version is 15, not 14. The wheels are built with MACOSX_DEPLOYMENT_TARGET 15.0. In the 2026-09-24 installer, libOpenMS links a bundled libzstd whose minimum OS is 15.0, so every TOPP tool needs macOS 15, not only the GUI, whose Qt dependencies are built for 15 as well. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YC1T2K9HQEUk2kQMZqC8h7 * [DOC] CHANGELOG: cite the PRs behind the macOS minimum; state the C++23 requirement The macOS line cited #8486, #8494 and #8527, which are notarization PRs; the references came along from a neighbouring bullet when the changelog was condensed. The minimum came from #8450 (14, with the Intel builds dropped), #9037 (15, together with C++23 and the macos-15 runners) and #10202 (15 for the wheels). The 3.6.0 changelog never said that OpenMS now needs C++23 (#9037). It now names the minimum compilers from cmake/min_compiler_versions.cmake. The dataframe page shows default_missing_values=None, the actual default of PeptideIdentificationList.to_df(), and what None stands for. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YC1T2K9HQEUk2kQMZqC8h7 * [DOC] peptide_search: call removeDanglingProteinReferences, not its 3.5 name updateProteinReferences is the pyOpenMS 3.5 name. The bindings PR brings it back only as a deprecated alias, and the page replay reports an example that teaches a deprecated call. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YC1T2K9HQEUk2kQMZqC8h7 --------- Co-authored-by: Claude <[email protected]>
Description
Checklist
How can I get additional information on failed tests during CI
Click to expand
If your PR is failing you can check outIf you click in the column that lists the failed tests you will get detailed error messages.
Advanced commands (admins / reviewer only)
Click to expand
/reformat(experimental) applies the clang-format style changes as additional commit. Note: your branch must have a different name (e.g., yourrepo:feature/XYZ) than the receiving branch (e.g., OpenMS:develop). Otherwise, reformat fails to push.rebuild jenkinswill retrigger Jenkins-based CI buildsSummary by CodeRabbit
Release Notes
✏️ Tip: You can customize this high-level summary in your review settings.