-
Notifications
You must be signed in to change notification settings - Fork 354
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
Add Docker Image reference, to be used for gitlab, docker, etc #4793
base: main
Are you sure you want to change the base?
Conversation
rewrite-java/src/main/java/org/openrewrite/java/ImageMatcher.java
Outdated
Show resolved
Hide resolved
rewrite-java/src/test/java/org/openrewrite/java/FindImageTest.java
Outdated
Show resolved
Hide resolved
rewrite-yaml/src/main/java/org/openrewrite/yaml/trait/YamlApplicationConfigReference.java
Show resolved
Hide resolved
rewrite-yaml/src/main/java/org/openrewrite/yaml/trait/YamlImageReference.java
Outdated
Show resolved
Hide resolved
rewrite-yaml/src/main/java/org/openrewrite/yaml/trait/YamlImageReference.java
Outdated
Show resolved
Hide resolved
rewrite-java/src/main/java/org/openrewrite/java/ImageMatcher.java
Outdated
Show resolved
Hide resolved
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
67fbd7f
to
2ad2e6f
Compare
rewrite-core/src/main/java/org/openrewrite/text/DockerImageReference.java
Outdated
Show resolved
Hide resolved
rewrite-xml/src/main/java/org/openrewrite/xml/trait/SpringReference.java
Outdated
Show resolved
Hide resolved
# Conflicts: # rewrite-xml/src/main/java/org/openrewrite/xml/trait/SpringXmlReference.java
Moved implementation files to So in the core it's just the Image reference + all needed things to set it up. In |
rewrite-core/src/main/java/org/openrewrite/SourceFileWithReferences.java
Outdated
Show resolved
Hide resolved
rewrite-properties/src/main/java/org/openrewrite/properties/trait/PropertiesReference.java
Show resolved
Hide resolved
rewrite-yaml/src/main/java/org/openrewrite/yaml/trait/YamlApplicationConfigReference.java
Outdated
Show resolved
Hide resolved
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.
Couple questions; other than that this is looking good already, thanks!
Sweet, updated the code a little bit 🙂 |
What's changed?
Added a new
IMAGE
reference type, which points to a docker image. Could be used for gitlab-ci files, docker files, testcontainers etc.Also did a little refactoring in the SourceFileWithReferences:
getReferences
cache logic can be once instead of every implementation.findMatches
method did also check for kind; as theReference.Matcher
does already do that, no need to do it here too.What's your motivation?
Run one find (and replace?) recipe to search for your docker images in one go, no matter how the image has been configured.
Anything in particular you'd like reviewers to focus on?
Be extra observant, as this is the first time I touch the Reference code. I put most of the code in the
rewrite-java
package, so maybe that could be improved as well.Checklist