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

Handle or ignore dependencies using commit hash instead of version number #5

Open
BartoszCichecki opened this issue Apr 9, 2024 · 5 comments

Comments

@BartoszCichecki
Copy link

Due to legacy reasons, some of our dependencies target specific commit hash instead of version number:

      {
        "package": "OHHTTPStubs",
        "repositoryURL": "https://github.com/AliSoftware/OHHTTPStubs",
        "state": {
          "branch": "9.1.0",
          "revision": "12f19662426d0434d6c330c6974d53e2eb10ecd9",
          "version": null
        }
      },

This results in an error like this being thrown:

/Users/vagrant/.asdf/installs/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/semantic-1.6.1/lib/semantic/version.rb:15:in `initialize': 12f19662426d0434d6c330c6974d53e2eb10ecd9 is not a valid SemVer Version (http://semver.org/) (ArgumentError)
      raise ArgumentError.new("#{version_str} is not a valid SemVer Version (http://semver.org/)") if v.nil?
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	from /Users/vagrant/.asdf/installs/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/danger-spm_version_updates-0.2.0/lib/spm_version_updates/plugin.rb:110:in `new'
	from /Users/vagrant/.asdf/installs/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/danger-spm_version_updates-0.2.0/lib/spm_version_updates/plugin.rb:110:in `warn_for_new_versions'
	from /Users/vagrant/.asdf/installs/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/danger-spm_version_updates-0.2.0/lib/spm_version_updates/plugin.rb:70:in `block in check_for_updates'
	from /Users/vagrant/.asdf/installs/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/danger-spm_version_updates-0.2.0/lib/spm_version_updates/plugin.rb:45:in `each'
	from /Users/vagrant/.asdf/installs/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/danger-spm_version_updates-0.2.0/lib/spm_version_updates/plugin.rb:45:in `check_for_updates'
	from Dangerfile:54:in `eval_file'

Not sure what is the best approach to this, maybe ignore these?

@hbmartin
Copy link
Owner

hbmartin commented Apr 9, 2024

This should be handled 🤔 Can you post the config for this package from Project.xcodeproj/project.xcodeproj

@hbmartin
Copy link
Owner

hbmartin commented Apr 9, 2024

What version of Xcode is being used? This plugin thinks the dependency was configured to be an "up to next major" package version and not commit pinned

@BartoszCichecki
Copy link
Author

BartoszCichecki commented Apr 9, 2024

Hmmm you are right, it is configured "upToNextMajor"... Apologies! Not sure what is going on here then. Xcode is 15.3 (latest).

41321DAA28FED725007FBACA /* XCRemoteSwiftPackageReference "OHHTTPStubs" */ = {
			isa = XCRemoteSwiftPackageReference;
			repositoryURL = "https://github.com/AliSoftware/OHHTTPStubs";
			requirement = {
				kind = upToNextMajorVersion;
				minimumVersion = 9.1.0;
			};
		};

@hbmartin
Copy link
Owner

hbmartin commented Apr 9, 2024

No apologies needed! I don't know of any spec for these things so reverse engineering Xcode's behavior(s) is the best I can do and these reports really help.
I'll have something out tomorrow or Thurs to handle this scenario. Thinking I might treat this as a branch dependency or otherwise try to reverse-resolve the commit hash.

@BartoszCichecki
Copy link
Author

Hey @hbmartin, any news?

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

No branches or pull requests

2 participants