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

modulegen: use cobra instead of native golang flag #1550

Merged
merged 2 commits into from
Aug 31, 2023
Merged

modulegen: use cobra instead of native golang flag #1550

merged 2 commits into from
Aug 31, 2023

Conversation

mmorel-35
Copy link
Contributor

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

What does this PR do?

This uses cobra instead of golang native flag .

This replaces the commands

go run . --name questdb --image "questdb/questdb:latest" --title QuestDB

with

go run . new example --name questdb --image "questdb/questdb:latest" --title QuestDB

And

go run . --name questdb --image "questdb/questdb:latest" --title QuestDB --as-module

with

go run . new module --name questdb --image "questdb/questdb:latest" --title QuestDB

The documentation of the command is available with --help on every command

go run . --help
go run . new module --help
go run . new example --help

Why is it important?

This will help provide more commands to modulegen.

Related issues

Follow-ups

Add new commands, complete documentation of the existing commands, see documentation.

@mmorel-35 mmorel-35 requested a review from a team as a code owner August 29, 2023 22:00
@netlify
Copy link

netlify bot commented Aug 29, 2023

Deploy Preview for testcontainers-go ready!

Name Link
🔨 Latest commit f30e13c
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-go/deploys/64f08c37f8dc040008901a20
😎 Deploy Preview https://deploy-preview-1550--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 draft August 30, 2023 06:13
@mmorel-35 mmorel-35 marked this pull request as ready for review August 30, 2023 07:30
@mmorel-35
Copy link
Contributor Author

Hi @mdelapenya ,
This will need an update in the website documentation

@mmorel-35 mmorel-35 changed the title modulegen: Use cobra instead of native golang flag modulegen: use cobra instead of native golang flag Aug 30, 2023
modulegen/main.go Outdated Show resolved Hide resolved
modulegen/module_cmd.go Outdated Show resolved Hide resolved
modulegen/example_cmd.go Outdated Show resolved Hide resolved
modulegen/main.go Outdated Show resolved Hide resolved
Copy link
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.

@mmorel-35 looks very promising! I added a few comments, not blockers, but wanted to check with you first before approving the PR (which is already done in my mind)

modulegen/cmd/new/example.go Outdated Show resolved Hide resolved
modulegen/cmd/new/main.go Outdated Show resolved Hide resolved
modulegen/internal/model/cmd.go Outdated Show resolved Hide resolved
modulegen/internal/module/main.go Outdated Show resolved Hide resolved
modulegen/internal/main.go Outdated Show resolved Hide resolved
@sonarcloud
Copy link

sonarcloud bot commented Aug 31, 2023

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 1 Code Smell

No Coverage information No Coverage information
0.9% 0.9% Duplication

@mdelapenya
Copy link
Member

Merging, as the CI always passed

Copy link
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 for the contribution! Now the modulegen seems a proper dev tool!

@mdelapenya mdelapenya self-assigned this Aug 31, 2023
@mdelapenya mdelapenya added the chore Changes that do not impact the existing functionality label Aug 31, 2023
@mdelapenya mdelapenya merged commit f4433dd into testcontainers:main Aug 31, 2023
16 checks passed
@mmorel-35 mmorel-35 deleted the cobra branch August 31, 2023 12:54
mdelapenya added a commit to mdelapenya/testcontainers-go that referenced this pull request Sep 1, 2023
* main:
  chore: define interfaces for file and project generation (testcontainers#1568)
  chore(deps): bump mkdocs-material from 8.2.7 to 9.2.6 (testcontainers#1567)
  chore(deps): bump the all group in /modules/neo4j with 1 update (testcontainers#1562)
  chore(deps): bump the all group in /modules/clickhouse with 1 update (testcontainers#1563)
  chore(deps): bump the all group in /modules/localstack with 1 update (testcontainers#1564)
  Update actions/github-script to 6.4.1 (testcontainers#1561)
  chore: Update Pipenv to use Python 3.8 (testcontainers#1558)
  feat: convert NATS example into a module (testcontainers#1559)
  chore(deps): bump the all group in /modulegen with 1 update (testcontainers#1554)
  modulegen: use cobra instead of native golang flag (testcontainers#1550)
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