Skip to content

Conversation

@fangpenlin
Copy link
Contributor

Description 📣

ref: https://linear.app/infisical/issue/PLATFRM-125/update-the-current-poc-with-design-doc-feedbacks

Type ✨

  • Bug fix
  • New feature
  • Improvement
  • Breaking change
  • Documentation

Tests 🛠️

# Here's some code block to paste some code snippets

@gitguardian
Copy link

gitguardian bot commented Dec 16, 2025

️✅ There are no secrets present in this pull request anymore.

If these secrets were true positive and are still valid, we highly recommend you to revoke them.
While these secrets were previously flagged, we no longer have a reference to the
specific commits where they were detected. Once a secret has been leaked into a git
repository, you should consider it compromised, even if it was deleted immediately.
Find here more information about risks.


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

add db

xxx

Use yaml struct instead, add backend

Add env vars

wrong img

Map volume

built in marshall

Fix volume

Generate client

Add makefile

Add compose helper

More helper

More helper

Use new helper

Remove unused stuff

get mapped port

Get port and host

Add provisioner

Add more helpers

Fix provisioning

xxx

Simple test

Fix cookies not passed in issue

Refine code

Extract helper

use helper

Map to a random port instead

Cleanup

Add machine identity & token

Register id

Update identity to allow token auth

Set default up timeout to 120 instead

Add operation id

Update deps

Test relay start

Set temp dir as home

Fix api url

Allow private ip

Try to add relays

Get relays

Add logs

Add TODO

Extract method

Fix tests

Fix asserts

Fix assert

Address feedbacks

Add execute context
@fangpenlin fangpenlin force-pushed the PLATFRM-125-e2e-test-poc branch from 7e8e11c to 8af2351 Compare December 16, 2025 19:03
@fangpenlin fangpenlin marked this pull request as ready for review December 17, 2025 19:26
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 17, 2025

Greptile Summary

  • Introduces comprehensive end-to-end testing infrastructure for Infisical CLI with Docker Compose orchestration, automated client code generation, and relay functionality testing
  • Modifies CLI command execution pattern to support better testing by returning errors instead of calling os.Exit(1) and adding context-aware execution
  • Adds automated OpenAPI client generation with endpoint filtering for focused E2E testing using oapi-codegen and proper Makefile automation

Important Files Changed

Filename Overview
e2e/relay/relay_test.go New comprehensive E2E test validating relay registration and heartbeat communication with proper Docker environment setup
main.go Updated main function to properly handle command errors and exit with status code 1 on failures
packages/relay/relay.go Added graceful shutdown handling with net.ErrClosed checks to support clean relay termination in tests
e2e/packages/client/provisioner.go New provisioner for bootstrapping test environments with admin accounts and tokens; contains error message bug on line 83
e2e/compose.yaml Docker Compose configuration using hardcoded credentials suitable for testing but lacking health checks

Confidence score: 4/5

  • This PR implements a well-structured E2E testing framework with comprehensive Docker orchestration and proper abstraction layers
  • Score reflects one bug found in error handling (wrong variable in error message) and some security considerations around hardcoded test credentials
  • Pay close attention to e2e/packages/client/provisioner.go line 83 where the error message uses wrong response variable
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

16 files reviewed, 7 comments

Edit Code Review Agent Settings | Greptile

return
}

stderr := cmd.Stderr()
Copy link
Member

Choose a reason for hiding this comment

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

This should be stdout right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope, stdout is ually for output data or result of the cmd. Usually people use stderr to output the logs or system info. We are using stderr to output the logs, so this is actually correct.

Copy link
Member

@akhilmhdh akhilmhdh Dec 19, 2025

Choose a reason for hiding this comment

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

Interesting!

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

Labels

None yet

3 participants