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

Upgrade to mautic/api-library v4.0.0-beta to fix incompatibility with psr/log v3 #40

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jhm-ciberman
Copy link

@jhm-ciberman jhm-ciberman commented Jan 30, 2025

Description

This PR upgrades mautic/api-library from v3.1.0 to v4.0.0-beta and removes the explicit constraint of psr/log v2, so the v3 can be used.

This allows users who cannot downgrade to psr/log v2 to still be able to use this library.

Important

This PR is intended to be merged and released under a beta pre-release tag. E.g: 1.0.0-beta or 0.4.0-beta. DO NOT release this under a stable version, otherwise it could affect existing consumers of the package.

Motivation and context

Fixes #38. The solution is also discused in #39.

The problem is the following:

  • mautic/api-library hasn't released a new stable version since 2022.
  • The current stable version of mautic/api-library v3.1.0 released on 2022 is incompatible with psr/log v3.
  • The pre-release version of mautic/api-library v4.0.0-beta released on Sep 3, 2024 addresses this issue and makes the library compatible with psr/log v3. However, it's been 4 months since that beta version and it is unknown if a new stable version will be released soon.

The proposed solution is the following:

  • Bump mautic/api-library from v3.1.0 to v4.0.0-beta so we can benefit from the new features and bug fixes of the new release.
  • Publish swisnl/laravel-mautic as v1.0.0-beta or v0.4.0-beta so it can be used in the meantime until mautic/api-library publishes a new stable version. It must be published with a beta pre-release version so composer doesn't use that version by default.

How has this been tested?

To be frank, I haven't tested it in depth because I don't have the tools to do so. I forked the repo, installed the dependencies, made the changes and run the tests.

After that I pushed to my fork and tested in my own private company project that the package installs correctly against my own branch:

{
    "require": {
        "mautic/api-library": "4.0.0-beta@beta",
        "swisnl/laravel-mautic": "dev-mautic-api-library-v4@dev",
    },
    "repositories": {
        "laravel-mautic": {
            "type": "vcs",
            "url": "https://github.com/jhm-ciberman/laravel-mautic.git"
        }
    }
}

I haven't manually tested the integration of mautic because I don't have any mautic integration code to test in the first place. But I think that is out of scope of this package and it's responsibility of the mautic/api-library package.

You can help me by skimming the diff between v3.1.0 and v4.0.0-beta and v4.0.0-beta changelog to check if you can identify any breaking change there in any method that this package uses.

Screenshots (if appropriate)

Types of changes

What types of changes does your code introduce? Put an x in all the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

Go over all the following points, and put an x in all the boxes that apply.

Please, please, please, don't send your pull request until all of the boxes are ticked. Once your pull request is created, it will trigger a build on our continuous integration server to make sure your tests and code style pass.

  • I have read the CONTRIBUTING document.
  • My pull request addresses exactly one patch/feature.
  • I have created a branch for this patch/feature.
  • Each individual commit in the pull request is meaningful.
  • I have added tests to cover my changes.
  • If my change requires a change to the documentation, I have updated it accordingly.

If you're unsure about any of these, don't hesitate to ask. We're here to help!

@@ -75,6 +74,7 @@
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true,
"php-http/discovery": true,
Copy link
Author

Choose a reason for hiding this comment

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

When I run composer update composer added that line for me. I don't think it's harmful but I am unsure of the benefits. It can be edited out of the PR if necessary.

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.

psr/log v3 support
1 participant