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(ci): run benchmarks for each storage in separate workers #1536

Merged
merged 27 commits into from
Jan 30, 2025

Conversation

mdelapenya
Copy link
Contributor

@mdelapenya mdelapenya commented Dec 28, 2024

What does this PR do?

It adds an initial job in the benchmark workflow in order to identify which modules where modified for a given build.

To detect the changes, we have created a shell script, ./github/scripts/changed-modules.sh. This script receives one single env var as input parameter, ALL_CHANGED_FILES, which on CI will be provided by a Github action, https://github.com/tj-actions/changed-files, that puts in there a list of the modified files, comparing the current PR changeset with the parent branch (main). We can tune this up to always check the latest main branch (open to discussion here).

The script will compare all existing modules (looking up all the go.mod files of interest, no test files) with the modified files, building an array of modified modules. At the moment there is a modified file in the .github directory, all the modules will be included in the build.

Finally, for running the benchmarks, we are adding a matrix for running them for the modified storage module, with the following rules:

  • all modules will run the benchmarks on ubuntu-latest.
  • services that are needed by a module will be started conditionally on the CI (e.g. redis, etcd)
  • the output file will prepend the module name, so that the final save-benchmark step can compare against that module, alone.

UPDATE: I've added the minio module to S3, so that the benchmarks for S3 work again.

Why is this important?

Separate concerns and better troubleshoot of issues with benchmarks: at the moment, all benchmarks are executed in serie, which 1) slows down the build, 2) could cause a PR to fail if one benchmark for another module failed.

With these changes we try to improve the contribution experience when working on one module.

Summary by CodeRabbit

  • New Features

    • Added a script to determine modules that need to be built based on modified files.
    • Introduced a custom endpoint resolver for S3, enhancing client configuration.
    • Enhanced S3 storage test setup with configurable MinIO image and credentials.
  • Chores

    • Improved test environment configuration for S3 storage testing.

Copy link
Contributor

coderabbitai bot commented Dec 28, 2024

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • .github/workflows/benchmark.yml is excluded by !**/*.yml

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This pull request introduces a new Bash script changed-modules.sh in the .github/scripts/ directory to dynamically determine which repository modules need to be built based on modified files. Simultaneously, the s3/init_test.go file is updated to enhance the MinIO test setup, providing more flexibility in configuring test environments by allowing dynamic image selection and improved connection parameter management. Additionally, a new custom endpoint resolver is added to s3/s3.go to extend the S3 client configuration capabilities.

Changes

File Change Summary
.github/scripts/changed-modules.sh New script to identify modules that require building based on modified files in a CI environment.
s3/init_test.go Enhanced MinIO test configuration with dynamic image selection and improved credential management. Constants for MinIO image and credentials added.
s3/s3.go Introduced a new custom endpoint resolver resolverV2 to enhance S3 client configuration without altering existing functionality.

Possibly related PRs

  • chore: use testcontainers-go for couchbase and minio #1508: This PR introduces the use of testcontainers-go for MinIO, which is relevant to the main PR's focus on managing modules and testing environments, particularly since both involve containerization and dynamic configuration for testing.

Poem

🐰 In the realm of code, a script takes flight,
Tracking modules with algorithmic might.
MinIO dances, tests now bright and clear,
Modules build, no complexity to fear!
A rabbit's tale of automation's glee 🚀


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@ReneWerner87
Copy link
Member

thank you, i also had such an idea for a short time, but then lost sight of it again

@mdelapenya
Copy link
Contributor Author

I faced troubles while contributing the testcontainers support in the other PR, and detected that the benchmark was failing for other reasons.

I'm not sure the implications of the changes with the benchmarks website, so please feel free to take over and change what you need

@mdelapenya mdelapenya marked this pull request as ready for review January 2, 2025 08:02
@mdelapenya mdelapenya requested a review from a team as a code owner January 2, 2025 08:02
@mdelapenya mdelapenya requested review from gaby, sixcolors, ReneWerner87 and efectn and removed request for a team January 2, 2025 08:02
@mdelapenya
Copy link
Contributor Author

Marked it as ready to review, as the only failure now is caused by a panic in the MySQL module.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (8)
s3/init_test.go (2)

32-33: Context handling
You have set up a Background() context for container orchestration. Consider if you need a WithTimeout context to avoid potential indefinite waits in case of container runtime failures.


43-47: Error handling
Panicking on container connection errors is acceptable for test code, but you may want to provide additional logging or use t.Fatal for clarity.

.github/scripts/changed-modules.sh (6)

17-17: Shellcheck SC2155
It's generally recommended to declare and assign variables in separate steps to avoid potential masking of return values in Bash.

Here’s an example adjustment:

- readonly ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)
+ cd "$(dirname "${BASH_SOURCE[0]}")/../.." || exit 1
+ readonly ROOT_DIR="$(pwd)"
🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 17-17: Declare and assign separately to avoid masking return values.

(SC2155)


27-27: Shellcheck SC2053
Quote the string when comparing with == to avoid unintended pattern matching.

- if [[ $1 == $excluded_module ]]; then
+ if [[ "$1" == "$excluded_module" ]]; then
🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 27-27: Quote the right-hand side of == in [[ ]] to prevent glob matching.

(SC2053)


36-36: Shellcheck SC2044
Using for with find output can be fragile. Consider a while-based approach or -exec.

-for modFile in $(find "${ROOT_DIR}" -name "go.mod" ...); do
+find "${ROOT_DIR}" -name "go.mod" ... | while read -r modFile; do
     ...
 done
🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 36-36: For loops over find output are fragile. Use find -exec or a while read loop.

(SC2044)


45-45: Shellcheck SC2207
When sorting an array in Bash, mapfile or read loops are safer than splitting on IFS.

- IFS=$'\n' modules=($(sort <<<"${modules[*]}"))
+ mapfile -t modules < <(printf '%s\n' "${modules[@]}" | sort)

Also applies to: 52-52

🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 45-45: Prefer mapfile or read -a to split command output (or quote to avoid splitting).

(SC2207)


72-72: Regex-based array checks
Using =~ on quoted strings in Bash can result in literal matches. Consider unquoting the pattern or checking membership with a loop.

🧰 Tools
🪛 Shellcheck (0.10.0)

[error] 72-72: Arrays implicitly concatenate in [[ ]]. Use a loop (or explicit * instead of @).

(SC2199)


[warning] 72-72: Remove quotes from right-hand side of =~ to match as a regex rather than literally.

(SC2076)


84-84: Output formatting
The surrounding quotes in echo "["$(IFS=,; echo "${modified_modules[*]}" | sed 's/ /,/g')"]" may inadvertently remove spacing. You might want to fully quote the entire echo command.

🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 84-84: The surrounding quotes actually unquote this. Remove or escape them.

(SC2027)


[warning] 84-84: Quote this to prevent word splitting.

(SC2046)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a0d6e6d and 472d68a.

⛔ Files ignored due to path filters (4)
  • .github/workflows/benchmark.yml is excluded by !**/*.yml
  • .github/workflows/test-s3.yml is excluded by !**/*.yml
  • s3/go.mod is excluded by !**/*.mod
  • s3/go.sum is excluded by !**/*.sum, !**/*.sum
📒 Files selected for processing (2)
  • .github/scripts/changed-modules.sh (1 hunks)
  • s3/init_test.go (2 hunks)
🧰 Additional context used
🪛 Shellcheck (0.10.0)
.github/scripts/changed-modules.sh

[warning] 17-17: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 27-27: Quote the right-hand side of == in [[ ]] to prevent glob matching.

(SC2053)


[warning] 36-36: For loops over find output are fragile. Use find -exec or a while read loop.

(SC2044)


[warning] 45-45: Prefer mapfile or read -a to split command output (or quote to avoid splitting).

(SC2207)


[warning] 52-52: Prefer mapfile or read -a to split command output (or quote to avoid splitting).

(SC2207)


[warning] 57-57: Assigning an array to a string! Assign as array, or use * instead of @ to concatenate.

(SC2124)


[warning] 67-67: Variable was used as an array but is now assigned a string.

(SC2178)


[warning] 67-67: Assigning an array to a string! Assign as array, or use * instead of @ to concatenate.

(SC2124)


[error] 72-72: Arrays implicitly concatenate in [[ ]]. Use a loop (or explicit * instead of @).

(SC2199)


[warning] 72-72: Remove quotes from right-hand side of =~ to match as a regex rather than literally.

(SC2076)


[warning] 84-84: The surrounding quotes actually unquote this. Remove or escape them.

(SC2027)


[warning] 84-84: Quote this to prevent word splitting.

(SC2046)

🔇 Additional comments (7)
s3/init_test.go (6)

4-4: Use of context package: good practice for test container management
Leveraging the context package for controlling container lifecycles is a great best practice.


9-9: Dependency import
Importing testcontainers-go for spinning up MinIO containers is appropriate here and helps keep tests self-contained.


18-24: Configurable MinIO environment variables
Defining constants for MinIO credentials and enabling override via TEST_MINIO_IMAGE is a robust way to parameterize tests.


27-30: Environmental override
Smart approach to override the default MinIO image from an environment variable. This ensures flexibility across environments.


34-38: Proper container setup
The container is configured with custom credentials. This is clean and makes the test more realistic.


51-51: Dynamic credentials
Replacing hard-coded credentials with the newly defined constants is a good improvement for maintainability.

Also applies to: 54-55

.github/scripts/changed-modules.sh (1)

57-57: Shellcheck SC2124
${ALL_CHANGED_FILES[@]} can collapse arrays into strings, possibly losing data. If ALL_CHANGED_FILES is expected to be a string, consider capturing it differently.

🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 57-57: Assigning an array to a string! Assign as array, or use * instead of @ to concatenate.

(SC2124)

.github/scripts/changed-modules.sh Outdated Show resolved Hide resolved
Shellcheck SC2178 / SC2124
Assigning arrays to a string variable can lead to unexpected behavior.
Shellcheck SC2207
When sorting an array in Bash, mapfile or read loops are safer than splitting on IFS.
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (4)
.github/scripts/changed-modules.sh (4)

16-21: Improve error handling in ROOT_DIR setup

Split the declaration and assignment to properly handle potential errors in directory resolution.

-readonly ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)
+declare -r ROOT_DIR
+ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd) || exit 1
🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 17-17: Declare and assign separately to avoid masking return values.

(SC2155)


44-54: Improve array sorting reliability

Use mapfile for more reliable array sorting.

-IFS=$'\n' modules=($(sort <<<"${modules[*]}"))
-unset IFS
+mapfile -t modules < <(printf '%s\n' "${modules[@]}" | sort)

-IFS=$'\n' allModules=($(sort <<<"${allModules[*]}"))
-unset IFS
+mapfile -t allModules < <(printf '%s\n' "${allModules[@]}" | sort)
🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 45-45: Prefer mapfile or read -a to split command output (or quote to avoid splitting).

(SC2207)


[warning] 52-52: Prefer mapfile or read -a to split command output (or quote to avoid splitting).

(SC2207)


80-84: Improve output formatting reliability

The current output formatting might break with special characters.

-echo "["$(IFS=,; echo "${modified_modules[*]}" | sed 's/ /,/g')"]"
+printf '[%s]\n' "$(IFS=,; echo "${modified_modules[*]}")"
🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 84-84: The surrounding quotes actually unquote this. Remove or escape them.

(SC2027)


[warning] 84-84: Quote this to prevent word splitting.

(SC2046)


1-84: Excellent approach to CI optimization!

The script effectively implements the PR's objective of running benchmarks for each storage in separate workers by:

  1. Intelligently detecting modified modules
  2. Supporting selective testing based on changes
  3. Enabling parallel execution of benchmarks

This will significantly improve the contribution experience by:

  • Reducing CI execution time
  • Isolating benchmark failures to specific modules
  • Preventing unrelated test failures
🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 17-17: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 27-27: Quote the right-hand side of == in [[ ]] to prevent glob matching.

(SC2053)


[warning] 36-36: For loops over find output are fragile. Use find -exec or a while read loop.

(SC2044)


[warning] 45-45: Prefer mapfile or read -a to split command output (or quote to avoid splitting).

(SC2207)


[warning] 52-52: Prefer mapfile or read -a to split command output (or quote to avoid splitting).

(SC2207)


[warning] 57-57: Assigning an array to a string! Assign as array, or use * instead of @ to concatenate.

(SC2124)


[error] 72-72: Arrays implicitly concatenate in [[ ]]. Use a loop (or explicit * instead of @).

(SC2199)


[warning] 72-72: Remove quotes from right-hand side of =~ to match as a regex rather than literally.

(SC2076)


[warning] 84-84: The surrounding quotes actually unquote this. Remove or escape them.

(SC2027)


[warning] 84-84: Quote this to prevent word splitting.

(SC2046)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 472d68a and 3de4b9e.

📒 Files selected for processing (1)
  • .github/scripts/changed-modules.sh (1 hunks)
🧰 Additional context used
🪛 Shellcheck (0.10.0)
.github/scripts/changed-modules.sh

[warning] 17-17: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 27-27: Quote the right-hand side of == in [[ ]] to prevent glob matching.

(SC2053)


[warning] 36-36: For loops over find output are fragile. Use find -exec or a while read loop.

(SC2044)


[warning] 45-45: Prefer mapfile or read -a to split command output (or quote to avoid splitting).

(SC2207)


[warning] 52-52: Prefer mapfile or read -a to split command output (or quote to avoid splitting).

(SC2207)


[warning] 57-57: Assigning an array to a string! Assign as array, or use * instead of @ to concatenate.

(SC2124)


[error] 72-72: Arrays implicitly concatenate in [[ ]]. Use a loop (or explicit * instead of @).

(SC2199)


[warning] 72-72: Remove quotes from right-hand side of =~ to match as a regex rather than literally.

(SC2076)


[warning] 84-84: The surrounding quotes actually unquote this. Remove or escape them.

(SC2027)


[warning] 84-84: Quote this to prevent word splitting.

(SC2046)

🔇 Additional comments (1)
.github/scripts/changed-modules.sh (1)

1-15: Well-documented script with clear test instructions!

The documentation effectively covers different test scenarios with expected outputs, making it easier for contributors to validate changes.

.github/scripts/changed-modules.sh Outdated Show resolved Hide resolved
.github/scripts/changed-modules.sh Outdated Show resolved Hide resolved
@gaby
Copy link
Member

gaby commented Jan 13, 2025

Lint issues seem to be related to bumping go?

I cannot see those lint issues 🙈 Could you point me to them please? 🙏

You dont see them here?
https://github.com/gofiber/storage/pull/1536/files#file-s3-s3-go-L175

Oh sorry, I expected them to appear here in the main screen without going to the files tab. Will take a look at asap, although I'm afraid those s3 deprecation warnings were already there before my changes. Do you want them to be resolved in this PR?

They just went away 😂

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
.github/scripts/changed-modules.sh (2)

16-24: Improve error handling in ROOT_DIR assignment

The current assignment could mask potential cd or pwd errors.

-readonly ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)
+declare -r ROOT_DIR
+ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd) || exit 1
🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 17-17: Declare and assign separately to avoid masking return values.

(SC2155)


1-81: Architectural consideration: Custom script vs third-party action

While third-party actions like tj-actions/changed-files can detect file changes, this script adds essential value by:

  1. Processing module-specific logic (extracting module names from paths)
  2. Handling excluded modules
  3. Formatting output specifically for matrix jobs

The custom implementation is justified as it handles use cases beyond simple file change detection.

🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 17-17: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 62-62: Expanding an array without an index only gives the first element.

(SC2128)


[error] 69-69: Arrays implicitly concatenate in [[ ]]. Use a loop (or explicit * instead of @).

(SC2199)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6ec8bcd and 412e272.

📒 Files selected for processing (1)
  • .github/scripts/changed-modules.sh (1 hunks)
🧰 Additional context used
🪛 Shellcheck (0.10.0)
.github/scripts/changed-modules.sh

[warning] 17-17: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 62-62: Expanding an array without an index only gives the first element.

(SC2128)


[error] 69-69: Arrays implicitly concatenate in [[ ]]. Use a loop (or explicit * instead of @).

(SC2199)

⏰ Context from checks skipped due to timeout of 90000ms (15)
  • GitHub Check: Compare (valkey)
  • GitHub Check: Compare (sqlite3)
  • GitHub Check: Compare (scylladb)
  • GitHub Check: Compare (s3)
  • GitHub Check: Compare (rueidis)
  • GitHub Check: Compare (ristretto)
  • GitHub Check: Compare (redis)
  • GitHub Check: Compare (postgres)
  • GitHub Check: Compare (pebble)
  • GitHub Check: Compare (nats)
  • GitHub Check: Compare (mongodb)
  • GitHub Check: Compare (couchbase)
  • GitHub Check: Compare (coherence)
  • GitHub Check: Compare (clickhouse)
  • GitHub Check: Analyse
🔇 Additional comments (5)
.github/scripts/changed-modules.sh (5)

1-15: Well-documented test cases!

The script includes clear examples of how to test different scenarios, which is excellent for maintainability.


25-32: Clean and safe implementation!

The is_excluded function follows shell scripting best practices with proper variable quoting and array iteration.


34-51: Robust module discovery implementation!

The code uses safe file processing patterns and proper array handling for sorting.


77-81: Clean output formatting!

The output formatting is well-documented and uses proper shell commands for consistent results.


52-75: ⚠️ Potential issue

Fix array handling and comparison logic

There are several issues in the modified files processing:

  1. Unsafe array iteration
  2. Inefficient array membership check
  3. Unquoted variable usage
-for file in $modified_files; do
+for file in "${modified_files[@]}"; do
     if [[ $file == .github/* ]]; then
         modified_modules=("${allModules[@]}")
         break
     fi

-    module_name=$(echo $file | cut -d'/' -f1)
+    module_name=$(echo "$file" | cut -d'/' -f1)
-    if [[ ! ${modified_modules[@]} =~ ${module_name} ]]; then
+    if ! printf '%s\n' "${modified_modules[@]}" | grep -q "^\"${module_name}\"$"; then
         if is_excluded "$module_name"; then
             continue
         fi
         modified_modules+=("\"$module_name\"")
     fi
 done

Likely invalid or redundant comment.

🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 62-62: Expanding an array without an index only gives the first element.

(SC2128)


[error] 69-69: Arrays implicitly concatenate in [[ ]]. Use a loop (or explicit * instead of @).

(SC2199)

modules_count: ${{ steps.set-modified-modules-count.outputs.modules_count }}
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
Copy link
Member

Choose a reason for hiding this comment

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

Use the version here, as it was

.github/workflows/benchmark.yml Outdated Show resolved Hide resolved
steps:
- name: Install MinIO
Copy link
Member

Choose a reason for hiding this comment

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

This was removed, and now the tests fail @mdelapenya

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll look at this today, as it should use the minio service provided by testcontainers

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the error is not because of not having a dedicated minio service in the GH workflow, but this #1536 (comment)

- detect-modules
strategy:
matrix:
module: ${{ fromJSON(needs.detect-modules.outputs.modules) }}
Copy link
Member

Choose a reason for hiding this comment

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

I think minio for s3 benchmarks is missing here too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the error is not because of not having a dedicated minio service in the GH workflow, but this #1536 (comment)

testStore = New(
Config{
Bucket: bucket,
Endpoint: "http://127.0.0.1:9000/",
Endpoint: "http://" + conn,
Copy link
Member

Choose a reason for hiding this comment

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

Something is not happy with this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm debugging this atm, will post updates as commits, sorry about that

Copy link
Contributor Author

@mdelapenya mdelapenya Jan 13, 2025

Choose a reason for hiding this comment

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

It seems an endpoint resolver is needed for the last S3 updates. IIRC I had to do the same for the S3 examples with localstack: https://docs.aws.amazon.com/sdk-for-go/v2/developer-guide/configure-endpoints.html#with-both

This is needed to avoid the BaseEndpoint to prepend the bucket name, as shown in the test errors

@@ -12,15 +15,44 @@ const (

var testStore *Storage

const (
// minioImage is the default image used for running S3 in tests.
minioImage = "docker.io/minio/minio:RELEASE.2024-08-17T01-24-54Z"
Copy link
Member

Choose a reason for hiding this comment

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

Use latest

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just copied the version from the current minio module. We could keep it as is, and bump the versions all together in a follow-up

@ReneWerner87
Copy link
Member

image i will wait for the adjustments

@mdelapenya
Copy link
Contributor Author

@ReneWerner87 I think there is some flakiness in the benchmarks workflow that is not caused by this PR. In the latest build, it failed because of arangodb, and some other, but in previous builds it was not the case.

My flair would say that there is something wrong in the client code for the given technology, but this is something I cannot confirm atm.

@ReneWerner87
Copy link
Member

Ok, will try it tomorrow locally with act

@ReneWerner87
Copy link
Member

my local tests were not successful

we are currently discussing internally how to proceed

@gaby
Copy link
Member

gaby commented Jan 19, 2025

@mdelapenya Could you update the workflow to use dorny/paths-filter instead of that shell script? There's also https://github.com/tj-actions/changed-files

@mdelapenya
Copy link
Contributor Author

I'm currently at Gophercon SG, please let me update it once I'm back (although I'll try to find a gap in between)

@gaby
Copy link
Member

gaby commented Jan 20, 2025

I'm currently at Gophercon SG, please let me update it once I'm back (although I'll try to find a gap in between)

That's awesome, no rush! Enjoy your trip!

* main: (22 commits)
  test new release drafter combi workflow
  test new release drafter combi workflow
  test new release drafter combi workflow
  test new release drafter combi workflow
  test new release drafter combi workflow
  test new release drafter combi workflow
  test new release drafter combi workflow
  test new release drafter combi workflow
  bump pkg´s
  test new release drafter combi workflow
  test new release drafter combi workflow
  test new release drafter combi workflow
  test new release drafter combi workflow
  test new release drafter combi workflow
  test new release drafter combi workflow
  dynamic change detection based on the folders in the first level of the repository dynamic generation of the release drafter config for the changed folders
  dynamic change detection based on the folders in the first level of the repository dynamic generation of the release drafter config for the changed folders
  Add timeout
  Rename variable
  Simplify even more
  ...
@mdelapenya
Copy link
Contributor Author

mdelapenya commented Jan 29, 2025

Hi folks! I'm back and used the new GH action to detect changes. It's simply amazing! I'm going to use it in the testcontainers-go repo too.

I ran this branch using act and the S3 benchmark passed, failing locally because it needs GH pages access to push the results to it. Other than than I'm happy to do more changes if you see it convenient

@mdelapenya mdelapenya requested a review from gaby January 29, 2025 11:54
@ReneWerner87
Copy link
Member

oh awsome, we will check it in the next days, thx

Copy link
Member

@gaby gaby left a comment

Choose a reason for hiding this comment

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

👍 LGTM, I'm curious if after merged it will run all the benchmarks?

@mdelapenya
Copy link
Contributor Author

I'm curious if after merged it will run all the benchmarks?

I have one concern about this too: what happens if somebody updates the benchmarks GH workflow? I'd like it to run all of them.

For the release drafter PR, did it run all of them when merged? I tried to copy whatever done in that PR

@ReneWerner87 ReneWerner87 merged commit e1e51a0 into gofiber:main Jan 30, 2025
10 checks passed
@mdelapenya
Copy link
Contributor Author

Thank you folks for this! I loved working with you simplifying the initial PR 🙇

I checked the merge commit, and it triggered the S3 benchmarks, only (as expected). Do we want to run all of them at merge time? Then I think we can add some conditions to detect a merge commit is processed and return the array with all packages instead.

Anyway, I think the current state is great for the experience of contributing to one single store package! I'll continue adding testcontainers support for the rest of the packages.

Cheers!

@gaby
Copy link
Member

gaby commented Jan 30, 2025

@mdelapenya Thank you, I think I know why. The filters step should only be run during a Pull Request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants