Skip to content

chore: use mapping syntax instead of sequence syntax #1323

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Marukome0743
Copy link
Contributor

@Marukome0743 Marukome0743 commented Apr 7, 2025

Description

This PR changes the environment variables style on compose.yaml file.

- MINIO_BROWSER_REDIRECT_URL=http://localhost/minio
+ MINIO_BROWSER_REDIRECT_URL: http://localhost/minio

The new FOO: BAR mapping syntax is prefer to - FOO=BAR sequence syntax at 2 points.

Fragments

First mapping syntax can use Fragments.

services:
  first:
    image: my-image:latest
    environment: &env
      FOO: BAR
      ZOT: QUIX
  second:
    image: another-image:latest
    environment:
      <<: *env
      YET_ANOTHER: VARIABLE

In example above, the environment variables must be declared using the FOO: BAR mapping syntax, while the sequence syntax - FOO=BAR is only valid when no fragments are involved.

Readable in IDE

sequence syntax mapping syntax
sequence mapping

The above images are Visual Studio Code.

The sequence syntax shows the all orange color environment variables.
On the other hand, the mapping syntax divides them into blue and orange color texts.
Therefore you can read them using FOO: BAR mapping syntax easily.

In conclusion, FOO: BAR mapping syntax is better than - FOO=BAR sequence syntax.

Summary by Sourcery

Update Docker Compose environment variable syntax from sequence to mapping style

Enhancements:

  • Improve readability of environment variable declarations
  • Enable support for YAML fragments in environment variable definitions

Chores:

  • Replace environment variable declaration syntax from sequence style (- FOO=BAR) to mapping style (FOO: BAR) across multiple Docker Compose configuration files

Copy link

sourcery-ai bot commented Apr 7, 2025

Reviewer's Guide by Sourcery

This pull request updates the Docker Compose files to use the mapping syntax (VARIABLE: value) instead of the sequence syntax (- VARIABLE=value) for defining environment variables. This change improves readability and allows for the use of fragments.

No diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Replaced sequence syntax with mapping syntax for defining environment variables in Docker Compose files.
  • Changed the syntax for defining environment variables from - VARIABLE=value to VARIABLE: value.
  • Updated environment variables in minio service.
  • Updated environment variables in postgres service.
  • Updated environment variables in gotrue service.
  • Updated environment variables in appflowy_cloud service.
  • Updated environment variables in admin_frontend service.
  • Updated environment variables in appflowy_ai service.
  • Updated environment variables in appflowy_worker service.
  • Updated environment variables in web service.
docker-compose.yml
Replaced sequence syntax with mapping syntax for defining environment variables in Docker Compose CI file.
  • Changed the syntax for defining environment variables from - VARIABLE=value to VARIABLE: value.
  • Updated environment variables in minio service.
  • Updated environment variables in postgres service.
  • Updated environment variables in gotrue service.
  • Updated environment variables in appflowy_cloud service.
  • Updated environment variables in admin_frontend service.
  • Updated environment variables in appflowy_ai service.
  • Updated environment variables in appflowy_worker service.
docker-compose-ci.yml
Replaced sequence syntax with mapping syntax for defining environment variables in Docker Compose Dev file.
  • Changed the syntax for defining environment variables from - VARIABLE=value to VARIABLE: value.
  • Updated environment variables in minio service.
  • Updated environment variables in postgres service.
  • Updated environment variables in gotrue service.
  • Updated environment variables in pgadmin service.
docker-compose-dev.yml
Replaced sequence syntax with mapping syntax for defining environment variables in Docker Compose Extras file.
  • Changed the syntax for defining environment variables from - VARIABLE=value to VARIABLE: value.
  • Updated environment variables in cloudflared service.
  • Updated environment variables in portainer_setup service.
  • Updated environment variables in pgadmin service.
docker-compose-extras.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @Marukome0743 - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Thanks for the detailed explanation of why the mapping syntax is preferred.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@Marukome0743 Marukome0743 force-pushed the mapping branch 2 times, most recently from b2f723a to 9d8f0d8 Compare April 14, 2025 04:31
@Marukome0743 Marukome0743 force-pushed the mapping branch 2 times, most recently from 64bad04 to e437014 Compare April 18, 2025 00:55
@Marukome0743 Marukome0743 force-pushed the mapping branch 4 times, most recently from 14c6372 to 18d14bb Compare May 14, 2025 00:59
@Marukome0743 Marukome0743 force-pushed the mapping branch 5 times, most recently from 8087f08 to 080f025 Compare May 30, 2025 00:41
@Marukome0743 Marukome0743 force-pushed the mapping branch 5 times, most recently from 5099f94 to 655e1ef Compare June 8, 2025 12:03
@Marukome0743 Marukome0743 force-pushed the mapping branch 5 times, most recently from c112d5a to 0146efc Compare June 16, 2025 02:41
@Marukome0743 Marukome0743 force-pushed the mapping branch 3 times, most recently from fc39a65 to 8c9d10d Compare June 23, 2025 00:12
@Marukome0743 Marukome0743 force-pushed the mapping branch 4 times, most recently from 3d38082 to c5134d9 Compare June 30, 2025 01:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant