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

Add Docker Image reference, to be used for gitlab, docker, etc #4793

Open
wants to merge 30 commits into
base: main
Choose a base branch
from

Conversation

jevanlingen
Copy link
Contributor

@jevanlingen jevanlingen commented Dec 17, 2024

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:

  • Made the class abstract, so the getReferences cache logic can be once instead of every implementation.
  • The findMatches method did also check for kind; as the Reference.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

  • I've added unit tests to cover both positive and negative cases
  • I've read and applied the recipe conventions and best practices
  • I've used the IntelliJ IDEA auto-formatter on affected files

@jevanlingen jevanlingen self-assigned this Dec 17, 2024
@jevanlingen jevanlingen added the enhancement New feature or request label Dec 17, 2024
@jevanlingen jevanlingen force-pushed the introduce-image-reference-and-recipe branch from 67fbd7f to 2ad2e6f Compare December 17, 2024 13:58
@Laurens-W Laurens-W mentioned this pull request Dec 20, 2024
3 tasks
@jevanlingen
Copy link
Contributor Author

Moved implementation files to

So in the core it's just the Image reference + all needed things to set it up. In rewrite-docker we have the actual recipe.

@jevanlingen jevanlingen marked this pull request as ready for review December 23, 2024 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Ready to Review
Development

Successfully merging this pull request may close these issues.

4 participants