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

Refactor package.resovled check #645

Conversation

andrewdmontgomery
Copy link
Contributor

@andrewdmontgomery andrewdmontgomery commented Jan 22, 2025

Closes #642

Description

This unwinds #643 and approaches the challenge differently, using existing plugins from Danger and Buildkite.

Testing Steps

  • Code review
  • See the screenshots below for my testing and links to build log entries
  • Optionally:
    1. Check out this branch at the commit before I reverted the TEST: Update... commit. [Check out: 9ea7e8b]
    2. Run danger locally against this PR at that commit
  • Optionally:
    1. Create a branch from this branch
    2. Modify the Package.swift manually (without updating the Package.resolved (Ideally, this change would remove a plugin, in order to reproduce the events that led to this change, but I think any change is sufficient)
    3. Run danger

@andrewdmontgomery andrewdmontgomery force-pushed the andrewdmontgomery/refactor-package.resovled-check branch from f3597e2 to a92e6bf Compare January 22, 2025 16:04
@andrewdmontgomery andrewdmontgomery force-pushed the andrewdmontgomery/refactor-package.resovled-check branch from ca49e78 to 1df52eb Compare January 22, 2025 16:15
@andrewdmontgomery andrewdmontgomery force-pushed the andrewdmontgomery/refactor-package.resovled-check branch from 1df52eb to 76f0f75 Compare January 22, 2025 16:16
@wpmobilebot
Copy link

wpmobilebot commented Jan 22, 2025

Gravatar Prototype Build📲 You can test the changes from this Pull Request in Gravatar Prototype Build by scanning the QR code below to install the corresponding build.
App NameGravatar Prototype Build Gravatar Prototype Build
Build Number2070
Version1.0
Bundle IDcom.automattic.gravatar-sdk-demo-uikit.prototype-build
Commit89a92ce
App Center BuildGravatar SDK Demo - UIKit #576
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@andrewdmontgomery
Copy link
Contributor Author

andrewdmontgomery commented Jan 23, 2025

This branch currently contains:

  • a temporarily modified Package.swift
  • Both Package.resolved files UNmodified

So the Dangerfile check should fail. And it does:
image

Note that only one error is returned. Danger appears to be deduplicating errors. I have confirmed locally that each function call causes the warning (by commenting out the other function call).

@andrewdmontgomery
Copy link
Contributor Author

andrewdmontgomery commented Jan 23, 2025

I just implemented the install_swiftpm_dependencies plugin, and would you look at this:

xcodebuild: error: Could not resolve package dependencies:
  an out-of-date resolved file was detected at /opt/ci/builds/builder/automattic/gravatar-sdk-ios/Demo/Gravatar-Demo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved, which is not allowed when automatic dependency resolution is disabled; please make sure to update the file to reflect the changes in dependencies. Running resolver because the following dependencies were added: 'swiftformat' (https://github.com/nicklockwood/SwiftFormat)

And it fails the build, too.

Let's keep the Dangerfile check. The output is easier to find.

image

…and both of the Package.resolved files"

This reverts commit a92e6bf.
@andrewdmontgomery
Copy link
Contributor Author

Placing this in Milestone 6, since it shouldn't block the release. I'm still targeting the release branch, though, in case we can merge it before we release.

Copy link
Contributor

@AliSoftware AliSoftware left a comment

Choose a reason for hiding this comment

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

:shipit:

@andrewdmontgomery andrewdmontgomery merged commit 3ab4e26 into release/3.2.0 Jan 24, 2025
14 checks passed
@andrewdmontgomery andrewdmontgomery deleted the andrewdmontgomery/refactor-package.resovled-check branch January 24, 2025 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants