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

Cache temporary redirections in the original location (#4459) #4547

Merged
merged 1 commit into from
Jan 10, 2025

Conversation

kysmith-csg
Copy link
Contributor

Some p2 sites can temporarily redirect to another location. In the case of JFrog Artifactory, these redirection URLs are too long to make as a file path, so the build would fail in this case. For temporary redirects, we save the artifact in the original location instead, since it's likely the redirection might change in the future. Permanent redirects will get their own cache entry as before.

Copy link

github-actions bot commented Dec 20, 2024

Test Results

  606 files    606 suites   4h 11m 57s ⏱️
  434 tests   425 ✅  7 💤 2 ❌
1 302 runs  1 277 ✅ 22 💤 3 ❌

For more details on these failures, see this check.

Results for commit 77b643c.

♻️ This comment has been updated with latest results.

@kysmith-csg
Copy link
Contributor Author

Text not found in log: No repository found at http://localhost:49744/repoB
org.apache.maven.it.VerificationException: Text not found in log: No repository found at http://localhost:49744/repoB
	at org.apache.maven.it.Verifier.verifyTextInLog(Verifier.java:351)
	at org.eclipse.tycho.test.tycho2938.ContentJarTest.redirectToBadLocation(ContentJarTest.java:89)
	at java.base/java.lang.reflect.Method.invoke(Method.java:569)

We get various other errors, but not this one :(

Running locally I get these three:

  1. Failed to load p2 metadata repository from location http://localhost:57700/repoB
  2. Unable to read repository at http://localhost:57700/repoB
  3. http://localhost:57700/repoB is not a valid repository location

@laeubi
Copy link
Member

laeubi commented Dec 27, 2024

This usually means something is messed up (e.g. redirection do not work anymore, mirrors not working runtime exception occurs and so on).

The best way then is to run

  • mvn clean install -T1C -DskipTests
  • go into tycho-its directory
  • run mvn clean install -Pits -Dtycho.mvnDebug=8000 -Dtest=<fqdn of test>#<failingTest>

this way you can debug one individual test.

Sometimes it also helps to change the test to dump the output to a file, then compare the output of before versus after to see if some log outputs change. One can also enable the debugging for the transport, just set some of these setting in the corresponding test verifier as system properties.

@kysmith-csg
Copy link
Contributor Author

@laeubi this test was actually for an invalid repository mirror. The test is verifying the error message, which after my changes I get a different one (but still the same reason - the repository is invalid). So I would say the test still "passes" but we just now get a different error message.

@laeubi
Copy link
Member

laeubi commented Jan 7, 2025

@kysmith-csg could you adjust the test then for the new message?

@kysmith-csg kysmith-csg force-pushed the issue-4459 branch 3 times, most recently from 58aba7c to 77b643c Compare January 7, 2025 15:38
@kysmith-csg
Copy link
Contributor Author

Never trust Github to update your fork... sorry for the noise.

Updated the test message.

@kysmith-csg
Copy link
Contributor Author

@laeubi this test failure doesn't seem related to my change. Even your latest commit failed because of this :)

@laeubi laeubi enabled auto-merge (rebase) January 10, 2025 05:20
@laeubi laeubi added the backport-to-tycho-4.0.x Can be added to a PR to trigger an automatic backport of the change label Jan 10, 2025
@laeubi laeubi merged commit e052363 into eclipse-tycho:main Jan 10, 2025
14 of 15 checks passed
@eclipse-tycho-bot
Copy link

💚 All backports created successfully

Status Branch Result
tycho-4.0.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

@kysmith-csg
Copy link
Contributor Author

Thank you @laeubi for handling this. Any chance of making a 4.0.11 release for this? It's currently impacting our organization and at least one other (the original author of the issue). We would greatly appreciate it.

@kysmith-csg kysmith-csg deleted the issue-4459 branch January 10, 2025 14:38
@laeubi
Copy link
Member

laeubi commented Jan 10, 2025

@kysmith-csg thanks for the fix and patience! In general it is always useful to use
try out the current tycho snapshot build to make sure everything would work before a release.

I think we have some important bugfixes already included so I will perform a release maybe next month but wanted to see some things settled, will this work for you?

@kysmith-csg
Copy link
Contributor Author

@laeubi I will try the snapshot build at some point and report back, thanks.

@kysmith-csg
Copy link
Contributor Author

@laeubi tested 4.0.11-SNAPSHOT (which I had to build locally because for some reason it wasn't using the snapshot repo) and confirmed it works.

A jar file download (https://my-site.com/files/foo.jar) that was redirected to a long url (https://my-very-very-long-site.com/qwertyuiop/files/foo.jar) site was cached in the directory for the original location from target-platform (.cache/tycho/https/my-site.com/files/plugins/foo.jar).

Confirmed by checking the foo.jar.headers file and the redirected location was there location=https://my-very-very-long-site.com/qwertyuiop/files/foo.jar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-to-tycho-4.0.x Can be added to a PR to trigger an automatic backport of the change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants