Skip to content
This repository was archived by the owner on Nov 23, 2026. It is now read-only.

[WIP] [full-ci] Add compatibility with Guzzle 7 - #5933

Closed
JammingBen wants to merge 1 commit into
masterfrom
guzzle7
Closed

JammingBen wants to merge 1 commit into
masterfrom
guzzle7

Conversation

@JammingBen

@JammingBen JammingBen commented Oct 21, 2021 •

Copy link
Copy Markdown
Contributor

Description

owncloud/core#39368 bumps Guzzle to v7 in core. Use the new GuzzleHttp\Psr7\MimeType class to determine mime types.

Also fixed some wrong indentations.

This is not supposed to be merged yet!

Types of changes

  • 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)
  • Technical debt
  • Tests

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

To-Do's:

  • Raise minimum OC version to 10.9 (or whatever OC version the Guzzle update lands in)
  • Changelog

@update-docs

update-docs Bot commented Oct 21, 2021

Copy link
Copy Markdown

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@ownclouders

Copy link
Copy Markdown
Contributor

Results for oCISFavorites https://drone.owncloud.com/owncloud/web/19861/53/1
💥 The acceptance tests pipeline failed. The build has been cancelled.

@pascalwengerter pascalwengerter left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@JammingBen CI failed with an oCIS error which most likely is unrelated. Feel free to add [full-ci] to the PR title to force running all acceptance tests to the end to see all failures. Also, we've switched CI to run OC10 with the latest release so you need to modify the CORE version in the .drone.star file and reference the version that has the bumped Guzzle version merged :)

@pascalwengerter
pascalwengerter marked this pull request as draft October 21, 2021 16:36
@pascalwengerter pascalwengerter changed the title Add compatibility with Guzzle 7 [WIP] Add compatibility with Guzzle 7 Oct 21, 2021
@pascalwengerter

Copy link
Copy Markdown
Contributor

@JammingBen we had a successful CI run for OC10.9 in #6063 - is this PR still relevant aka is it waiting for the official 10.9 release?

@JammingBen

Copy link
Copy Markdown
Contributor Author

We decided to wait with this after 10.9 has been released. So still relevant, but "on hold" :)

@pascalwengerter

Copy link
Copy Markdown
Contributor

We decided to wait with this after 10.9 has been released. So still relevant, but "on hold" :)

Ping for updating this one, should be fine to merge soon I suppose now that 10.9 is out in the wild 🐗

@sonarqubecloud

sonarqubecloud Bot commented Feb 8, 2022

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@phil-davis phil-davis changed the title [WIP] Add compatibility with Guzzle 7 [WIP] [full-ci] Add compatibility with Guzzle 7 Jun 17, 2022
@phil-davis

Copy link
Copy Markdown
Contributor

I rebased this just now. We are still waiting for a decision on when to merge the core Guzzzle7 PR.

core oC 10.9 and 10.10 still use Guzzle5.

@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@kulmann

kulmann commented Jun 20, 2022

Copy link
Copy Markdown
Contributor

I rebased this just now. We are still waiting for a decision on when to merge the core Guzzzle7 PR.

core oC 10.9 and 10.10 still use Guzzle5.

For clarification: this means that we need to bump a new major version when this PR is merged, correct? I.e. Immediate incompatibility with ownCloud up to 10.10, right?

@phil-davis

Copy link
Copy Markdown
Contributor

For clarification: this means that we need to bump a new major version when this PR is merged, correct? I.e. Immediate incompatibility with ownCloud up to 10.10, right?

core master now has Guzzle7 - that will be 10.11 release when it happens. Nowadays CI only tests against core latest (currently 10.10), which does not have Guzzle7.

Mimetype::fromFilename is the main change here.

This PR will need to be merged and a release made for web to work all correctly with oC10.11. And that release won't work with 10.10 and before. So what to do:

  • support 2 release streams for a while, releasing web patches/features in 2 release streams?
  • change this code so that it checks/discovers which of GuzzleHttp\Mimetypes or GuzzleHttp\Psr7\MimeType exists at run-time and executes the appropriate code for private function getMimeType
  • or ?

@jnweiger

Copy link
Copy Markdown
Contributor

Web 5.7.0 on core 10.11.0-alpha.2 fails to start with internal server error.

The logfile has:

{"reqId":"YvOypmH0RNAAl-7XZSJVNAAAAAc","level":3,"time":"2022-08-10T13:29:10+00:00","remoteAddr":"46.114.89.20","user":"admin","app":"index","meth
od":"GET","url":"\/index.php\/apps\/web\/index.html","message":"Exception: {\"Exception\":\"Error\",\"Message\":\"Class 'GuzzleHttp\\\\Mimetypes' 
not found\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/owncloud\\\/apps-external\\\/web\\\/lib\\\/Controller\\\/FilesController.php(107): OCA\\\\
Web\\\\Controller\\\\FilesController->getMimeType()\\n#1 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/Http\\\/Dispatcher.php(17
0): OCA\\\\Web\\\\Controller\\\\FilesController->getFile()\\n#2 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/Http\\\/Dispatcher
.php(89): OC\\\\AppFramework\\\\Http\\\\Dispatcher->executeController()\\n#3 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/App.p
hp(100): OC\\\\AppFramework\\\\Http\\\\Dispatcher->dispatch()\\n#4 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/Routing\\\/Rout
eActionHandler.php(47): OC\\\\AppFramework\\\\App::main()\\n#5 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/Route\\\/Router.php(344): OC\\\\App
Framework\\\\Routing\\\\RouteActionHandler->__invoke()\\n#6 \\\/var\\\/www\\\/owncloud\\\/lib\\\/base.php(914): OC\\\\Route\\\\Router->match()\\n#
7 \\\/var\\\/www\\\/owncloud\\\/index.php(54): OC::handleRequest()\\n#8 {main}\",\"File\":\"\\\/var\\\/www\\\/owncloud\\\/apps-external\\\/web\\\/
lib\\\/Controller\\\/FilesController.php\",\"Line\":136}"}

With files_primary_s3, @phil-davis did some magic to support both, guzzle7 and guzzle5 simultaenously. Mabye we should do something similar here?

@phil-davis

Copy link
Copy Markdown
Contributor

With files_primary_s3, @phil-davis did some magic to support both, guzzle7 and guzzle5 simultaenously. Mabye we should do something similar here?

Link to "magic" owncloud/files_primary_s3#583

We can find out at run-time whatg Guzzle is available by checking for the existence and value of \GuzzleHttp\Client::MAJOR_VERSION

@jnweiger

jnweiger commented Sep 7, 2022 •

Copy link
Copy Markdown
Contributor

Reproduced on core 10.11.0-rc.1 with both, bundled web 5.6.1 and unreleased web 5.7.0-rc.11

@pmaier1 The web UI cannot be started at all. Is this a blocker?

@kulmann

kulmann commented Sep 8, 2022

Copy link
Copy Markdown
Contributor

Not needed anymore, since we found a different solution for mime type checking. see #7605

@kulmann kulmann closed this Sep 8, 2022
@kulmann
kulmann deleted the guzzle7 branch September 5, 2024 19:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants