-
Notifications
You must be signed in to change notification settings - Fork 23
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
PHAR version requires "_HumbugBox" prefixed implementation of ProviderInterface #81
Comments
@heiglandreas Have you run into this? Any ideas on how to fix it? |
After a bit of digging I think that the compactor does this for PHAR code isolation. Funny sidenote: Apparently,
😄 So, maybe it's a feature, not a bug? |
I just discovered the same regarding code isolation, @rieschl . However, I tried locally building the phar without the code isolation compactor, and it appears to work fine. As such, I'm going to create a patch and do a release around that, as that version appears to fix the issues in this and #82. Can you do me a favor, and do the following please?
and then report to me if there are still issues. I don't think there will be, but I am definitely curious. |
Oh, important note: remove line three of the |
That is actually a feature. It is a so called "scoped PHAR" (I blogged about that). The issue is that the scope-namespace needs to be added to the config file... I'll see whether that can automagically added... |
We probably need to whitelist the Providers as described in the PHP-Scoper docs... |
Right, I also discovered that in the meantime 😄
I played around a bit with that. Whitelisting the Interface or the implementation doesn't solve the problem. It's probably also necessary if we want to keep the scoped PHAR. Whitelisting scopes the class but also adds a The problem is the scoping of
to
Because of that the check fails if the
Yes, removing the scoper solves that issue and also #82. But I'm not the one to decide to remove the scoping of the PHAR file. Probably there won't be an issue if we remove the scoping because the PHAR doesn't interact with other classes of the project it is used in. But I haven't used box-project or php-scoper before so I could be wrong. I'd be happy to create a PR if you want. |
@heiglandreas So, I see three separate issues, then:
Locally, I checked to see if I could resolve either issue, in a variety of ways. First, removed the scoping compactor entirely, and all problems were resolved. Second, I tried adding a Third, I tried whitelisting the various classes in that same namespace individually. This resolved the second issue, but not the third. Looking into the third, I tried whitelisting the As an experiment, I tried changing The scoper documentation indicates that certain strings that reference classes can be rewritten, but it seems arbitrary that one and not the other is not rewritten in this case. This makes me think #82 may actually be a bug with either the Box project or the PHP-Scoper project. I'm going to continue looking into this, but if either of you have ideas, please share! |
Bug Report
Summary
It seems that the packaging to a PHAR file does some monkey business with the namespace of the project. The provider has to be an instance of
_HumbugBoxaa7bf30d75ed\Phly\KeepAChangelog\Provider\ProviderInterface
.Current behaviour
When releasing a version with
keep-a-changelog version:release 1.2.3
an error is raised:The provider as currently configured is incapable of performing a release.
Problem is in the config file the provider class is
Phly\KeepAChangelog\Provider\GitHub
whereas the PHAR wants an implementation of_HumbugBoxaa7bf30d75ed\Phly\KeepAChangelog\Provider\ProviderInterface
.How to reproduce
Download the PHAR file, create a global config with
keep-a-changelog config:create -g
, set the GitHub token and try to release a version. The error above is raised. When changing the provider to_HumbugBoxaa7bf30d75ed\Phly\KeepAChangelog\Provider\GitHub
it works as expected.Expected behaviour
The
_HumbugBoxaa7bf30d75ed
namespace shouldn't be there.It seems every packaging creates a random string after the prefix
_HumbugBox
. I also tested it with version2.8.1
. The namespace is_HumbugBoxdcb0919ddeeb
there.The text was updated successfully, but these errors were encountered: