Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Match macOS software <-> titles using bundle identifier #19969

Merged
merged 27 commits into from
Jul 9, 2024

Conversation

roperzh
Copy link
Member

@roperzh roperzh commented Jun 24, 2024

for #19144 and #20171

Checklist for submitter

If some of the following don't apply, delete the relevant line.

  • Changes file added for user-visible changes in changes/, orbit/changes/ or ee/fleetd-chrome/changes.
    See Changes files for more information.
  • Input data is properly validated, SELECT * is avoided, SQL injection is prevented (using placeholders for values in statements)
  • Added/updated tests
  • If database migrations are included, checked table schema to confirm autoupdate
  • For database migrations:
    • Checked schema for all modified table for columns that will auto-update timestamps during migration.
    • Confirmed that updating the timestamps is acceptable, and will not cause unwanted side effects.
    • Ensured the correct collation is explicitly set for character columns (COLLATE utf8mb4_unicode_ci).
  • Manual QA for all new/changed functionality

Base automatically changed from 19144-upload-matching to main June 25, 2024 13:55
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this binary was created using this script:

#!/bin/bash

PACKAGE_ID="com.example.dummy"
PACKAGE_VERSION="1.0.0"
INSTALL_LOCATION="DummyApp.app"

TEMP_DIR=$(mktemp -d)
PAYLOAD_DIR="$TEMP_DIR/payload"

mkdir -p "$PAYLOAD_DIR"
pkgbuild --root "$PAYLOAD_DIR" --identifier "$PACKAGE_ID" --version "$PACKAGE_VERSION" "$TEMP_DIR/dummy.pkg"

DISTRIBUTION_XML="$TEMP_DIR/Distribution"
cat <<EOF > "$DISTRIBUTION_XML"
<?xml version="1.0" encoding="utf-8"?>
<installer-script minSpecVersion="1.0">
    <title>Dummy Installer</title>
    <choices-outline>
        <line choice="default">
            <line choice="dummy"/>
        </line>
    </choices-outline>
    <choice id="default"/>
    <pkg-ref id="$PACKAGE_ID" version="$PACKAGE_VERSION" auth="root">
      <bundle-version>
	<bundle CFBundleShortVersionString="$PACKAGE_VERSION" CFBundleVersion="$PACKAGE_VERSION" id="$PACKAGE_ID" path="$INSTALL_LOCATION"/>
      </bundle-version>
    </pkg-ref>
</installer-script>
EOF

productbuild --distribution "$DISTRIBUTION_XML" --resources "$TEMP_DIR" --package-path "$TEMP_DIR" "dummy_installer.pkg"
rm -rf "$TEMP_DIR"
echo "Dummy .pkg installer created: dummy_installer.pkg"

Copy link
Member

@mna mna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great (and I did manually test the fix for another ticket, worked perfectly)!

Only some questions where I was unsure about the handling of NULLs.

Co-authored-by: Martin Angers <martin.n.angers@gmail.com>
mna
mna previously approved these changes Jul 9, 2024
@roperzh
Copy link
Member Author

roperzh commented Jul 9, 2024

hey @getvictor, can you take a look at this when time allows? pinging you as a code owner and because from the git blame I think you have the most context.

gillespi314
gillespi314 previously approved these changes Jul 9, 2024
Copy link
Contributor

@gillespi314 gillespi314 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Just a minor question for my own curiosity.

server/service/integration_enterprise_test.go Outdated Show resolved Hide resolved
Copy link
Member

@getvictor getvictor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good.

Probably too late now, but I would have used a more generic identifier instead of Apple-specific bundle_identifier so that we can reuse this for Windows/Linux/etc later if needed.

@roperzh roperzh merged commit e90b90d into main Jul 9, 2024
19 checks passed
@roperzh roperzh deleted the 19144-pkg-matching branch July 9, 2024 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants