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

chore: generate dependabot configs for examples #654

Merged

Conversation

mdelapenya
Copy link
Collaborator

@mdelapenya mdelapenya commented Dec 5, 2022

What does this PR do?

It models dependabot config file, using it to generate dependabot configs for each generated example module.

This generation has this requirements:

  • the main module comes first in dependabot.yml
  • the existing e2e module comes second
  • all the examples comes after, in alphabetical order. This is provided by the sort.Sort function, therefore the Updates struct implements the Len, Less and Swap methods of the Sort interface. We can sort updates by its directory.

Why is it important?

Update example modules with dependencies in an automated manner

Related issues

@mdelapenya mdelapenya requested a review from a team as a code owner December 5, 2022 17:54
@mdelapenya mdelapenya self-assigned this Dec 5, 2022
Copy link
Member

@eddumelendez eddumelendez left a comment

Choose a reason for hiding this comment

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

besides adding the new section for the new example is removing the quotes to the existing ones

Screenshot 2022-12-05 at 11 59 00

@mdelapenya
Copy link
Collaborator Author

Interesting 🤔 let me check how the YAML library is marshaling the strings, as it should include the quotes

@mdelapenya
Copy link
Collaborator Author

At the same time, go-yaml/yaml#556 (comment)

Marshaling will not quote values unless they change their meaning when unquoted.

which makes me think that it does not matter if they are quoted or not. As an Ansible user, I'd prefer them quoted, tbh

I can add the yaml.Node implementation to force the formatting

@eddumelendez
Copy link
Member

I think we should remove them first in main branch. So, adding a new example is just update the file with the right changes. WDYT?

@mdelapenya
Copy link
Collaborator Author

I think we should remove them first in main branch. So, adding a new example is just update the file with the right changes. WDYT?

Indeed. Let me elaborate a PR doing it so

.github/dependabot.yml Outdated Show resolved Hide resolved
Copy link
Member

@eddumelendez eddumelendez left a comment

Choose a reason for hiding this comment

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

when adding a new example the format change. Once this is fixed we are ready to go!

Screenshot 2022-12-05 at 12 30 40

@mdelapenya
Copy link
Collaborator Author

@eddumelendez I think go-yaml is still producing valid indents for a YAML file even though the original indents are not honored. Please see go-yaml/yaml#779

* main:
  chore: format dependabot using go-yaml indents (testcontainers#658)
  chore(deps): bump github.com/docker/compose/v2 from 2.12.2 to 2.14.0 (testcontainers#657)
  chore(deps): bump github.com/stretchr/testify from 1.8.0 to 1.8.1 (#583)
  chore(deps): bump github.com/cenkalti/backoff/v4 from 4.1.3 to 4.2.0 (testcontainers#656)
@mdelapenya mdelapenya merged commit 65c6fd8 into testcontainers:main Dec 5, 2022
@mdelapenya mdelapenya deleted the include-dependabot-in-generator branch December 5, 2022 22:56
@mdelapenya mdelapenya added the chore Changes that do not impact the existing functionality label Dec 7, 2022
mdelapenya added a commit to mdelapenya/testcontainers-go that referenced this pull request Dec 15, 2022
* main:
  chore: generate dependabot configs for examples (testcontainers#654)
  chore: format dependabot using go-yaml indents (testcontainers#658)
  chore(deps): bump github.com/docker/compose/v2 from 2.12.2 to 2.14.0 (testcontainers#657)
  chore(deps): bump github.com/stretchr/testify from 1.8.0 to 1.8.1 (#583)
  chore(deps): bump github.com/cenkalti/backoff/v4 from 4.1.3 to 4.2.0 (testcontainers#656)
  chore: remove quotes from dependabot updates (testcontainers#655)
  fix: do not create garbage in examples nav bar (testcontainers#652)
  chore(deps): bump github.com/containerd/containerd from 1.6.8 to 1.6.10 (#621)
  chore(deps): bump golang.org/x/sys from 0.1.0 to 0.3.0 (testcontainers#651)
mdelapenya added a commit to mdelapenya/testcontainers-go that referenced this pull request Dec 21, 2022
* main: (79 commits)
  chore: reduce concurrent builds (testcontainers#702)
  chore: add mysql example (testcontainers#700)
  chore(deps): bump google.golang.org/api from 0.104.0 to 0.105.0 (testcontainers#699)
  chore(deps): bump google.golang.org/api in /examples/firestore (testcontainers#683)
  chore(deps): bump cloud.google.com/go/spanner in /examples/spanner (testcontainers#688)
  chore(deps): bump google.golang.org/api in /examples/pubsub (testcontainers#685)
  chore(deps): bump google.golang.org/api in /examples/spanner (testcontainers#684)
  chore(deps): bump google.golang.org/grpc in /examples/firestore (testcontainers#686)
  chore(deps): bump google.golang.org/api in /examples/bigtable (testcontainers#680)
  chore(deps): bump google.golang.org/api in /examples/datastore (testcontainers#678)
  chore(deps): bump golang.org/x/text from 0.3.7 to 0.5.0 (testcontainers#660)
  chore(deps): bump github.com/magiconair/properties from 1.8.6 to 1.8.7 (testcontainers#677)
  chore: postgres example (testcontainers#674)
  Add bigtable example (testcontainers#676)
  chore(deps): bump github.com/containerd/containerd from 1.6.10 to 1.6.12 (testcontainers#675)
  chore: run go mod tidy in examples (testcontainers#672)
  Improve datastore, firestore, pubsub and spanner tests (testcontainers#670)
  chore: group dependabot updates (testcontainers#668)
  chore: update mkdocs format to go-yaml v3 (testcontainers#667)
  chore: generate dependabot configs for examples (testcontainers#654)
  ...
mdelapenya added a commit to slsyy/testcontainers-go that referenced this pull request Dec 21, 2022
* main: (335 commits)
  chore: reduce concurrent builds (testcontainers#702)
  chore: add mysql example (testcontainers#700)
  chore(deps): bump google.golang.org/api from 0.104.0 to 0.105.0 (testcontainers#699)
  chore(deps): bump google.golang.org/api in /examples/firestore (testcontainers#683)
  chore(deps): bump cloud.google.com/go/spanner in /examples/spanner (testcontainers#688)
  chore(deps): bump google.golang.org/api in /examples/pubsub (testcontainers#685)
  chore(deps): bump google.golang.org/api in /examples/spanner (testcontainers#684)
  chore(deps): bump google.golang.org/grpc in /examples/firestore (testcontainers#686)
  chore(deps): bump google.golang.org/api in /examples/bigtable (testcontainers#680)
  chore(deps): bump google.golang.org/api in /examples/datastore (testcontainers#678)
  chore(deps): bump golang.org/x/text from 0.3.7 to 0.5.0 (testcontainers#660)
  chore(deps): bump github.com/magiconair/properties from 1.8.6 to 1.8.7 (testcontainers#677)
  chore: postgres example (testcontainers#674)
  Add bigtable example (testcontainers#676)
  chore(deps): bump github.com/containerd/containerd from 1.6.10 to 1.6.12 (testcontainers#675)
  chore: run go mod tidy in examples (testcontainers#672)
  Improve datastore, firestore, pubsub and spanner tests (testcontainers#670)
  chore: group dependabot updates (testcontainers#668)
  chore: update mkdocs format to go-yaml v3 (testcontainers#667)
  chore: generate dependabot configs for examples (testcontainers#654)
  ...
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.

None yet

2 participants