-
Notifications
You must be signed in to change notification settings - Fork 1
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
Bump org.hamcrest:hamcrest-core from 1.3 to 3.0 in /deploy/aws/java11Exec #657
Bump org.hamcrest:hamcrest-core from 1.3 to 3.0 in /deploy/aws/java11Exec #657
Conversation
65bca50
to
b993705
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am fine with updating Hamcrest, and we should probably allow the upgrade. For the production environment, I prepared it with openHPI/dockerfiles#36, too.
However, there is one "issue" I see here, namely our AWS execution environment.
.map(s -> s.replaceAll("/usr/java/lib/hamcrest-core-1\\.3\\.jar", "/var/task/lib/org.hamcrest.hamcrest-core-1.3.jar")) | |
.map(s -> s.replaceAll("/usr/java/lib/junit-4\\.13\\.jar", "/var/task/lib/junit.junit-4.13.2.jar")) |
There, we are relying on the fixed paths. First, I made the following replacements in the existing Makefile
s:
/usr/java/lib/hamcrest-core-1.3.jar
->${HAMCREST}
/usr/java/lib/junit-4.13.jar
->${JUNIT}
I then continued and removed the manual specification of the class path:
Previously:
test:
javac -encoding utf8 -cp .:${HAMCREST}:${JUNIT} ${FILENAME}
java -Dfile.encoding=UTF8 -cp .:${HAMCREST}:${JUNIT} org.junit.runner.JUnitCore ${CLASS_NAME}
Now:
test:
javac -encoding utf8 ${FILENAME}
java -Dfile.encoding=UTF8 org.junit.runner.JUnitCore ${CLASS_NAME}
To ease the transition, it might be enough to set the CLASSPATH
environment variable (that should work, I assume?). Here's some more background on the environment variables for Java. The following AWS docs might be useful, which could result in something like:
ProcessBuilder pb = new ProcessBuilder(cmd);
pb.directory(workingDirectory);
Map<String, String> env = pb.environment();
env.put("CLASSPATH", ".:/var/task/lib/org.hamcrest.hamcrest-core-3.0.jar:/var/task/lib/junit.junit-4.13.2.jar:" + env.get("CLASSPATH"));
Process p = pb.start();
for the current implementation
poseidon/deploy/aws/java11Exec/src/main/java/poseidon/App.java
Lines 96 to 98 in ed52052
ProcessBuilder pb = new ProcessBuilder(cmd); | |
pb.directory(workingDirectory); | |
Process p = pb.start(); |
b993705
to
035e91a
Compare
Thank you for already suggesting the changes! Additionally, I just had to adjust a test case. Deploying this state allows execute commands in the AWS functions even with file system manipulation. No errors could be identified. |
97b2e20
to
731aae3
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #657 +/- ##
==========================================
+ Coverage 76.36% 76.39% +0.02%
==========================================
Files 43 43
Lines 3660 3660
==========================================
+ Hits 2795 2796 +1
+ Misses 630 629 -1
Partials 235 235 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deploying this state allows execute commands in the AWS functions even with file system manipulation.
That's a positive thing, I hope? It's not about a malicious change, but the regular changes to the file system I assume?
Yes 😅 |
3cb99ab
to
49d54dc
Compare
Bumps [org.hamcrest:hamcrest-core](https://github.com/hamcrest/JavaHamcrest) from 1.3 to 3.0. - [Release notes](https://github.com/hamcrest/JavaHamcrest/releases) - [Changelog](https://github.com/hamcrest/JavaHamcrest/blob/master/CHANGES.md) - [Commits](hamcrest/JavaHamcrest@hamcrest-java-1.3...v3.0) --- updated-dependencies: - dependency-name: org.hamcrest:hamcrest-core dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Sebastian Serth <[email protected]>
49d54dc
to
c939c35
Compare
Thanks, I updated the remaining lines and redeployed them. It still works fine! env
ls -lah /var/task/lib/
|
Awesome, thanks! Checking with the output from Just one remaining question though: Why do we still see |
Maybe because |
Yeah, I agree 👍
|
Awesome, than we have this resolved and are up-to-date with our usage! |
Bumps org.hamcrest:hamcrest-core from 1.3 to 3.0.
Release notes
Sourced from org.hamcrest:hamcrest-core's releases.
... (truncated)
Changelog
Sourced from org.hamcrest:hamcrest-core's changelog.
Commits
68984b8
Version 3.01adc351
Fix javadoc title4e2b71c
Add instructions for releasing to Maven Central3fa841d
Revert version to 3.0-SNAPSHOT750dc36
Prepare for version 3.0-rc11703e95
Fix broken tutorial link in READMEc4578ef
Upgrade Gradle 8.8 -> 8.9a9923af
Remove old, unused build definitionscf25e14
Cleanup README, fix broken linksbc4769e
Upgrade to GitHub-native Dependabot (#342)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot show <dependency name> ignore conditions
will show all of the ignore conditions of the specified dependency@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)