KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Composer token duration #911

Open Andrea Puggioni opened this topic on on Jun 7, 2019 - 32 comments

Andrea Puggioni commented on Jun 7, 2019

Hi, We use jenkins as continuous integration system that (at every commit) checkout the project source from git, launch composer update, execute unit tests and deploy to staging server.

Yesterday we removed koolreport pro from our repositories and start to require it with coposer but after 1 hour the builds started to fail because of token expiration.

We need a permanent token.

KoolReport commented on Jun 10, 2019

Understood the issue, we are working on the solution.

KoolReport commented on Jun 10, 2019

Dear Andrea,

You may try again now. Although the token still expired in 1 hour, it supposed not to cause error for composer.

Let me know if it works.

Toby Beresford commented on Jul 4, 2019

So are you saying that the token doesn't expire anymore? We use GitLab for CI and are concerned we'll hit the same problem

KoolReport commented on Jul 5, 2019

No the token is still expired in 1hour, just that it will not cause error and stop your building process. Please try to fix the version of KoolReport in your composer.json, it will be fine.

Toby Beresford commented on Jul 6, 2019

Heya

Hmm. It doesn't seem to work (I just bought the Excel package FYI). I had no problem downloading locally with auth.json etc. I've added auth.json into my repo so that the unit test runner has the ability to download using the same code.

This is what I'm seeing on the Pipeline when we try to run unit tests from within a Docker container:

Thanks for any help you can give.

  - Installing koolreport/core (4.0.0): Downloading (connecting...)Downloading (100%)         
  - Installing markbaker/matrix (1.1.4): Downloading (connecting...)Downloading (0%)           Downloading (5%)Downloading (10%)Downloading (15%)Downloading (20%)Downloading (25%)Downloading (30%)Downloading (35%)Downloading (40%)Downloading (45%)Downloading (50%)Downloading (55%)Downloading (60%)Downloading (65%)Downloading (70%)Downloading (75%)Downloading (80%)Downloading (85%)Downloading (90%)Downloading (95%)Downloading (100%)
  - Installing markbaker/complex (1.4.7): Downloading (connecting...)Downloading (0%)           Downloading (25%)Downloading (35%)Downloading (60%)Downloading (70%)Downloading (95%)Downloading (100%)
  - Installing phpoffice/phpspreadsheet (1.8.1): Downloading (connecting...)Downloading (0%)           Downloading (5%)Downloading (10%)Downloading (15%)Downloading (20%)Downloading (25%)Downloading (30%)Downloading (35%)Downloading (40%)Downloading (45%)Downloading (50%)Downloading (55%)Downloading (60%)Downloading (65%)Downloading (70%)Downloading (75%)Downloading (80%)Downloading (85%)Downloading (90%)Downloading (95%)Downloading (100%)
  - Installing koolreport/excel (6.0.0): Downloading (connecting...)Downloading (100%)             Failed to download koolreport/excel from dist: The checksum verification of the file failed (downloaded from https://repo.koolreport.com//dist/koolreport/excel/koolreport-excel-a5d55b459ab0a8daba9722688ceab73b64af78da-zip-c30ad3.zip)
    Now trying to download from source
  - Installing koolreport/excel (6.0.0): Cloning a5d55b459a

                                                                                                                                                                                                                                                                                                    
  [RuntimeException]                                                                                                                                                                                                                                                                                
  Failed to execute git clone --no-checkout 'git@github.com:koolreport/excel.git' '/builds/abc/vendor/koolreport/excel' && cd '/builds/abc/vendor/koolreport/excel' && git remote add composer 'git@github.com:koolreport/excel.git' && git fetch composer `
KoolReport commented on Jul 7, 2019

That's strange that it works from your local but not from your server. Let me inform the dev.team if they knows what might happens from the error.

David Winterburn commented on Jul 8, 2019

Hi Toby,

Would you please try to run "composer clear-cache" and "composer update" one time on your server? Thanks!

Toby Beresford commented on Jul 8, 2019

Hi David

It's a docker container so it's an entirely fresh install during the unit test process.

I've added the composer clear-cache to the install script.

See results:

I also just double checked - I removed the library from my local and then required it again. It all downloaded fine using that password.

Any other suggestions?

Thanks

Toby

David Winterburn commented on Jul 8, 2019

Hi Toby,

Is your token in auth.json newly active or expired? Please make sure the token is new for first time composer install.

In case the token is new and the error still happens, please change the install script to:

composer install --ignore-platform-reqs -vvv

and let us know the detail error message. Thanks!

Toby Beresford commented on Jul 8, 2019

Hi David

It's an expired token but when using Docker on GitLab surely it's always going to be a first time install? Every time it spins up a entirely fresh docker instance of the server to run the unit tests.

Does your authentication technology work with Docker instances?

I don't understand why you don't just stop the token expiring?

I will send the full job script to your email address.

Toby

Toby Beresford commented on Jul 8, 2019

It works fine on the unit test Docker instance if I use a new token however that doesn't solve my issue. I will see if it still works if I try the unit test pipeline again in one hour and report back.

Toby Beresford commented on Jul 8, 2019

Ok so that worked! Don't fully understand why, but it worked. Will now try in production. Thanks for your help.

KoolReport commented on Jul 8, 2019

Great that it works! Anything please let us know.

Toby Beresford commented on Jul 9, 2019

So the unit test with docker on gitlab worked in production yesterday but no longer works today. Are there any other solutions you can suggest? Is there a different auth method to the package we can use please? A permanent token would be ideal.

KoolReport commented on Jul 11, 2019

We will mark your idea as our suggestion. The expired token seems safer, may be we can increase the token validity time.

Toby Beresford commented on Jul 11, 2019

Safer for you but of no use to your customers!

You really need to say this when selling that it won't work in dockerised environments. Otherwise people are paying for something they can't use.

KoolReport commented on Jul 12, 2019

Understand. By the way, there is a quick solution that you move "koolreport" folder to outside of vendor folder. You can remove koolreport and excel package in composer.json. Of course, in somewhere, you need to include the koolreport manually with require_one "/path/to/koolreport/core/autoload.php"; By this way, you can avoid this token issue for now.

Toby Beresford commented on Jul 12, 2019

Aha ok will try that and report back.

Toby Beresford commented on Jul 17, 2019

Hi that avoids the issue for now but is obviously only a temporary solution so please let us know when you have a longer term fix.

KoolReport commented on Jul 17, 2019

Yeah, we will find a better solution

Michael Menefee commented on Aug 22, 2019

We are also being heavily impacted by this. Automated build systems, our developer local workstations, and our production environment is all broken right now due to this change. We must have a better solution - this is not workable in the long term. Permanent tokens, or even just the ability to manually load files into the vendor folder. The "old way" was working just fine and quite stable. As all of our systems are automated via chef and other tools, having this require manual interaction to deploy code is not a workable solution.

KoolReport commented on Aug 22, 2019

Hi Michael,

What do you mean by the "old way"? Do you mean just by downloading the library and put to project?

Michael Menefee commented on Aug 28, 2019

Correct - just putting the files. The file method allowed me to check the latest version into our get repo, and then the composer process would just "overlay" on the folder. This way, no one ever had an issue, and they could just clone, run composer install, and start coding.

As it stands, I have now spent many hours preparing a development VM that I will now have to distribute to many developers around the world, simply because we do not have a way of creating a repository that can both a) be automatically deployed to the cloud and b) be deployed to a local development machine without involving logging in and pushing the "button". I.e. our devs can't just clone from our main git repo anymore and expect to be able to set up the application with "composer install", even though I have the koolreport files in the vendor directory checked into the repo explicitly. This has created a significant headache for us, right as I'm trying to spin up 5 new devs onto our project.

KoolReport commented on Aug 28, 2019

We bring you a good news that the old way still works. We just add the new way in addition to the old way. You do not need to use composer to install our packages. Instead just hit the download button at the clients section, unzip the file and put the koolreport folder somewhere in your project. Just requiring the file /path/to/koolreport/autoload.php and then everything will works.

Cord commented on Oct 8, 2019

Great composer is supported now, not so great the token expires. All workarounds are annoying... looking at e.g. nova.laravel.com there is a private non expiring token, so composer is fully supported even for this commercial package. Wonder if you could implement this as well?

Michael Menefee commented on Dec 15, 2019

Following up on this - the "old way" is still different. My autoload is deeply integrated into my framework - I cannot easily do an arbitrary autoload call. In the "old way", I added the koolreport repo via composer, and then copied the "pro" files into the vendor/koolreport folder. This was simple, as I simply added the vendor/koolreport/pro (or whatever it was called) subfolder to my git repo. No issues whatsoever, and it just overlaid on the existing process and did not require an explicit call to autoload.

As it stands, that "old way" no longer works due to the new package structure.

Therefore I am forced to use the new way, which is not very compatible with CI and other approaches.

This still needs to be addressed. We're all running workaround "hacks" as a part of production code, and this has been going on for many months. Needs to be fixed - it is difficult to even stand up a new developer machine with this approach if they check the code out from scratch.

David Winterburn commented on Dec 16, 2019

Hi Michael,

Even though there's a change in KoolReport's package structure you still can use your own way if I understand correctly. The most important autoload file is vendor/KoolReport/core/autoload.php. As long as you could add KoolReport/core package to your composer setup all would be fine. And the core package doesn't need a private token.

For the licensed packages, just download KoolReport Pro or the individual packages and put them in your repo's vendor/KoolReport folder.

Please try this approach and let us know if there's any problem that needs to be solved. Thanks!

KoolReport commented on Dec 16, 2019

If you downloaded "koolreport" manually, the new structure will look like this:

koolreport\
--- core
--- export
--- excel

If you want to keep the old way of folder organization, you can cut & paste the package folder into "\koolreport\core\packages" like this:

koolreport\
--- core
     ---- packages
           --- export
           --- excel

If there is no "packages" folder in the core, create one. It stil works and the structure is the same like old way.

So you can download the koolreport pro, organize abit, push it to private repository (must be private) to integrate into CI using composer. Or you can add koolreport as part of your code (not in the vendor folder but your codebase).

Perry Holden commented on Dec 31, 2019

There is no reason whatsoever to have the token expiring. None. I have never heard of any other third-party software company having this restriction, ever. This is an entirely unnecessary constraint, especially when your customers are using some form of cloud hosting or docker. Yes, I can technically install the code directly, but I don't want to do that. I want to use composer. Really, this needs to change.

Edit: Just a quick follow-up. We can still technically use composer if we want to install the package using composer artifacts. (https://getcomposer.org/doc/05-repositories.md#artifact). While the end result is the same as adding it manually to vendor, you can still use things like composer-patches on it, which is useful for some people. Basically, you download the ZIP file, add it to a folder in your repo, then you can set that folder as an artifact repository. Composer will install the package from that ZIP. Again, not perfect, but something temporary for now.

KoolReport commented on Jan 2, 2020

Big announcement on this issue: We have set the token expiry to your KoolReport Pro subscription expiry. If you own perpetual usage, the token expiry time will be in year 2100, virtually no expiration. Note that, if you need upgrade KoolReport Pro, you must generate new token.

This update is currently in beta so if you run to any issue, please let us know.

Happy Coding!

Perry Holden commented on Jan 2, 2020

That is great news. Does that include single library licenses, such as inputs or Excel? Or only if you have the entire Pro license?

KoolReport commented on Jan 2, 2020

@Perry: It is for koolreport pro now only.

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
suggestion

None