Skip to content

modulegen: create internal/module and internal/modfile#1539

Merged
mdelapenya merged 1 commit intotestcontainers:mainfrom
mmorel-35:modulegen/module
Aug 29, 2023
Merged

modulegen: create internal/module and internal/modfile#1539
mdelapenya merged 1 commit intotestcontainers:mainfrom
mmorel-35:modulegen/module

Conversation

@mmorel-35
Copy link
Copy Markdown
Contributor

@mmorel-35 mmorel-35 commented Aug 27, 2023

What does this PR do?

This PR move the logic of go.mod construction from main package to internal/modfile package.
It also replaces the use of a template to the use of golang.org/x/mod library. This allows to read the go version and the main package informations from the main go.mod and use it to construct the new module.
As there is no more template for go.mod, the script for updating go version is updated too.

It also moves the construction of example.go and example_test.go to internal/module.

As the testcontainer-go version is directly retrieved from mkdocs.yml this property is not provided as an Example property.

Why is it important?

This is separating code in there domain to improve the readability and maintanability.

Related issues

Follow-ups

@netlify
Copy link
Copy Markdown

netlify bot commented Aug 27, 2023

Deploy Preview for testcontainers-go ready!

Name Link
🔨 Latest commit 63e31c7
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-go/deploys/64edd2503f1d480008889c7e
😎 Deploy Preview https://deploy-preview-1539--testcontainers-go.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@mmorel-35 mmorel-35 marked this pull request as ready for review August 28, 2023 12:15
@mmorel-35 mmorel-35 requested a review from a team as a code owner August 28, 2023 12:15
mdelapenya
mdelapenya previously approved these changes Aug 29, 2023
Copy link
Copy Markdown
Member

@mdelapenya mdelapenya left a comment

Choose a reason for hiding this comment

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

Cool, thanks! This LGTM and it's ready to be merged 👏 I myself understand the code but anybody else in the community could not understand the rationale behind the usage of gomod Vs keeping the template. BTW this is cool!

I'd appreciate if you use the PR template to include a description of what this PR does (technical implementation) and why is needed (product needs), because I see PR descriptions as a way of documentation for these two personas: a community member, and the future ourselves in the need to check why we did something in such a way in the past.

So I'd ask you for filling in the PR description before merging it 🙏

@mmorel-35
Copy link
Copy Markdown
Contributor Author

Ok @mdelapenya ,
Does this description is enough or do you need me to precise more on certain parts ?

@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

No Coverage information No Coverage information
0.0% 0.0% Duplication

@mdelapenya
Copy link
Copy Markdown
Member

Ok @mdelapenya , Does this description is enough or do you need me to precise more on certain parts ?

Now it's perfect. Thanks for your hard work improving the module generator 🚀

@mdelapenya mdelapenya self-assigned this Aug 29, 2023
@mdelapenya mdelapenya added the chore Changes that do not impact the existing functionality label Aug 29, 2023
@mmorel-35
Copy link
Copy Markdown
Contributor Author

mmorel-35 commented Aug 29, 2023

You're welcome ;) !

There was a typo in some names "mode" instead of "mod" was used. That's why I updated the code.

Copy link
Copy Markdown
Member

@mdelapenya mdelapenya left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@mdelapenya mdelapenya merged commit 987c6d0 into testcontainers:main Aug 29, 2023
@mmorel-35 mmorel-35 deleted the modulegen/module branch August 29, 2023 11:43
mdelapenya added a commit to mdelapenya/testcontainers-go that referenced this pull request Aug 29, 2023
* main:
  modulegen: create internal/module and internal/modfile (testcontainers#1539)
mdelapenya added a commit to mdelapenya/testcontainers-go that referenced this pull request Aug 29, 2023
* main:
  modulegen: generate md file inside internal/mkdocs (testcontainers#1543)
  modulegen: create internal/module and internal/modfile (testcontainers#1539)
mdelapenya added a commit to mdelapenya/testcontainers-go that referenced this pull request Aug 30, 2023
* main: (32 commits)
  fix: remove wrong example from workspace (testcontainers#1556)
  chore(deps): bump the all group in /modules/localstack with 1 update (testcontainers#1552)
  modulegen: generate code-workspace with json marshal (testcontainers#1551)
  chore(deps): bump the all group in /modules/compose with 2 updates (testcontainers#1553)
  feat: add mariadb module (testcontainers#1548)
  feat(modulegen): print out VSCode workspace file if needed (testcontainers#1549)
  modulegen: generate md file inside internal/mkdocs (testcontainers#1543)
  modulegen: create internal/module and internal/modfile (testcontainers#1539)
  [Enhancement]: add ability to set repo:tag for ContainerRequest FromDockerfile (testcontainers#1508)
  Fix module generator for examples (testcontainers#1545)
  Update pulsar.md (testcontainers#1542)
  modulegen: create internal/make (testcontainers#1537)
  chore: fix workflow (testcontainers#1538)
  chore(deps): bump the all group in /examples/cockroachdb with 1 update (testcontainers#1522)
  chore(deps): bump the all group in /examples/bigtable with 1 update (testcontainers#1534)
  chore(deps): bump the all group in /modules/localstack with 4 updates (testcontainers#1535)
  chore(deps): bump the all group in /modules/k3s with 2 updates (testcontainers#1526)
  chore(deps): bump the all group in /examples/spanner with 2 updates (testcontainers#1532)
  chore(deps): bump the all group in /examples/firestore with 1 update (testcontainers#1523)
  chore(deps): bump the all group in /modules/redis with 1 update (testcontainers#1524)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Changes that do not impact the existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants