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

Generate protobuf code for TypeScript service - Frontend #1954

Conversation

Sozhan308
Copy link
Contributor

@Sozhan308 Sozhan308 commented Jan 25, 2025

Changes

Part of #1787 to generate profobuf files for all services.

This PR implements pre-generation of protobuf definitions for the frontend service

  1. Created a dedicated Dockerfile for protobuf generation

    • Added src/frontend/genproto/Dockerfile for handling proto generation
  2. Updated main frontend Dockerfile

    • Removed protobuf generation from build stage
    • Added pre-generated protos copy
    • Removed unnecessary protobuf dependencies from runner stage

Testing

  • Verified proto generation using docker-gen-proto.sh

Merge Requirements

For new features contributions, please make sure you have completed the following
essential items:

  • CHANGELOG.md updated to document new feature additions
  • Appropriate documentation updates in the docs
  • Appropriate Helm chart updates in the helm-charts

Maintainers will not merge until the above have been completed. If you're unsure
which docs need to be changed ping the
@open-telemetry/demo-approvers.

@Sozhan308 Sozhan308 requested a review from a team as a code owner January 25, 2025 20:16
Copy link
Member

@julianocosta89 julianocosta89 left a comment

Choose a reason for hiding this comment

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

LGTM, thx for taking care of this one @Sozhan308!

@julianocosta89
Copy link
Member

✔ Recommendation Service (http://tracetest-server:11633/testsuite/recommendation-all/run/1)
	✔ Recommendation: List products (http://tracetest-server:11633/test/recommendation-list/run/1/test) - trace id: 7507f8baeb358ca28e4e18ca89c73db4
		✔ It called ListRecommendations correctly and got 5 products

✔ Email (http://tracetest-server:11633/testsuite/email-all/run/1)
	✔ Email: Confirmation (http://tracetest-server:11633/test/email-confirmation/run/1/test) - trace id: 43a33eb6c09d5ed8054ae8a2054ebb0f
		✔ It should be called successfully
		✔ It should render a email to send
		✔ It should send an email

✔ Currency Service (http://tracetest-server:11633/testsuite/currency-all/run/1)
	✔ Currency: Convert (http://tracetest-server:11633/test/currency-convert/run/1/test) - trace id: 57b0471a0b4294baf3f7a6ee890ae1f5
		✔ It converts from USD to CAD
		✔ It has more nanos than expected
	✔ Currency: Supported (http://tracetest-server:11633/test/currency-supported/run/1/test) - trace id: 933567595ce97af37b97e1d416cf01f7
		✔ It has a span called "Currency/GetSupportedCurrencies"
		✔ It returns the expected currency codes

✔ Ad Service (http://tracetest-server:11633/testsuite/ad-all/run/1)
	✔ Ad: get (http://tracetest-server:11633/test/ad-get-ads/run/1/test) - trace id: 60d89c84c6351465638b3c839e748b78
		✔ It returns two ads
		✔ It returns a valid redirectUrl for each ads

✔ Checkout Service (http://tracetest-server:11633/testsuite/checkout-all/run/1)
	✔ Checkout: place order (http://tracetest-server:11633/test/checkout-place-order/run/1/test) - trace id: a28e59d5f545cb89dfcc74e94dee4583
		✔ It returns a valid order
		✔ It calls the PlaceOrder method successfuly
		✔ It sends an order to be processed asyncronously

✔ Product Catalog (http://tracetest-server:11633/testsuite/product-catalog-all/run/1)
	✔ Product: List (http://tracetest-server:11633/test/product-list/run/1/test) - trace id: 3449cc3e790ac66229d3e612d2fd502c
		✔ It queried the product catalog correctly
		✔ It returned products with IDs
	✔ Product: Get (http://tracetest-server:11633/test/product-get/run/1/test) - trace id: 84a506b702008b1966fffaa8a0a88fc8
		✔ It queried the product catalog correctly for a specific product
		✔ It returned a product with valid attributes
	✔ Product: Search (http://tracetest-server:11633/test/product-search/run/1/test) - trace id: 662319eefcb581bf9942e989e5360bcc
		✔ It called SearchProducts correctly and it returned 1 item
		✔ It returned the desired product

✔ Shipping Service (http://tracetest-server:11633/testsuite/shipping-all/run/1)
	✔ Shipping: Quote (http://tracetest-server:11633/test/shipping-quote/run/1/test) - trace id: d88a2ab4e9769de8158cd752d7618b1d
		✔ It called GetQuote correctly
		✔ It returned a valid quote
	✔ Shipping: Empty Quote (http://tracetest-server:11633/test/shipping-empty-quote/run/1/test) - trace id: 0a5259b3179f978767f66013885aca88
		✔ It called GetQuote correctly
		✔ It returned a valid quote
	✔ Shipping: Order (http://tracetest-server:11633/test/shipping-order/run/1/test) - trace id: 45dbef6e63342c7535746c9a70e8d53d
		✔ It called GetQuote correctly
		✔ It returned a trackingId

✔ Payment (http://tracetest-server:11633/testsuite/payment-all/run/1)
	✔ Payment: valid credit card (http://tracetest-server:11633/test/payment-valid-credit-card/run/1/test) - trace id: 1ecf1768d14229f846ef783ea0a98ec5
		✔ It should call Charge method successfully
		✔ It should return a transaction ID
	✔ Payment: invalid credit card (http://tracetest-server:11633/test/payment-invalid-credit-card/run/1/test) - trace id: 8a20bd606cb6dc65c7dd2839f5e9b700
		✔ It should call Charge method and receive a gRPC error
		✔ It should return a return an gRPC error code to the caller
	✔ Payment: Amex credit card not allowed (http://tracetest-server:11633/test/payment-amex-credit-card-not-allowed/run/1/test) - trace id: 038a3388afd093e87b6b0b39e976b715
		✔ It should call Charge method and receive a gRPC error
		✔ It should return a return an gRPC error code to the caller
	✔ Payment: expired credit card (http://tracetest-server:11633/test/payment-expired-credit-card/run/1/test) - trace id: a813e764ab2fe8d0d71330335750379f
		✔ It should call Charge method and receive a gRPC error
		✔ It should return a return an gRPC error code to the caller

✔ Cart Service (http://tracetest-server:11633/testsuite/cart-all/run/1)
	✔ Cart: empty cart (http://tracetest-server:11633/test/cart-empty-cart/run/1/test) - trace id: c32b2f48086456867cc916670818e79d
		✔ It emptied the shopping cart with success
		✔ It sent cleaning message to the database
	✔ Cart: add item to cart (http://tracetest-server:11633/test/cart-add-item-to-cart/run/1/test) - trace id: 400933f59439999958cf2c82e6a99206
		✔ It added an item correctly into the shopping cart
		✔ It set the cart item correctly on the database
		✔ It returned an empty cart
	✔ Cart: check if cart is populated (http://tracetest-server:11633/test/cart-check-if-cart-is-populated/run/1/test) - trace id: abf2b89b0150854082d30efa0735bbd1
		✔ It retrieved the cart items correctly
		✔ It returned the first item with correct attributes
	✔ Cart: empty cart (http://tracetest-server:11633/test/cart-empty-cart/run/2/test) - trace id: eabdd7fc789cb092ce77926f6a2f3ad0
		✔ It emptied the shopping cart with success
		✔ It sent cleaning message to the database
	✔ Cart: check if cart is empty (http://tracetest-server:11633/test/cart-check-if-cart-is-empty/run/1/test) - trace id: 0434339e2c075d1224b9e233b1c6b579
		✔ It retrieved the cart items correctly
		✔ It returned no items

✔ Frontend Service (http://tracetest-server:11633/testsuite/frontend-all/run/1)
	✔ Frontend: See Ads (http://tracetest-server:11633/test/frontend-see-adds/run/1/test) - trace id: 21e20f6a60fa36ea660295e033c5fe1e
		✔ It called the frontend with success and got a valid redirectUrl for each ads
		✔ It returns two ads
	✔ Frontend: Get recommendations (http://tracetest-server:11633/test/frontend-get-recommendation/run/1/test) - trace id: 38ac7a346d97fd25cd236127b4b9167b
		✔ It called the frontend with success
		✔ It called ListRecommendations correctly and got 5 products
	✔ Frontend: Browse products (http://tracetest-server:11633/test/frontend-browse-product/run/1/test) - trace id: ca5f825875c0edfa1f411138dcdfd07e
		✔ It called the frontend with success and got a product with valid attributes
		✔ It queried the product catalog correctly for a specific product
	✔ Frontend: Add product to the cart (http://tracetest-server:11633/test/frontend-add-product/run/1/test) - trace id: 310816acc97d737455de4450a1e6bd52
		✔ It called the frontend with success
		✔ It added an item correctly into the shopping cart
		✔ It set the cart item correctly on the database
	✔ Frontend: View cart (http://tracetest-server:11633/test/frontend-view-cart/run/1/test) - trace id: a346f67a5ee403769cee1cef187ccba1
		✔ It called the frontend with success
		✔ It retrieved the cart items correctly
	✔ Frontend: Checking out shopping cart (http://tracetest-server:11633/test/frontend-checkout-shopping-cart/run/1/test) - trace id: e3dc07155a00f78b8cccfed727c8b914
		✔ It called the frontend with success
		✔ The order was placed
		✔ The user was charged
		✔ The product was shipped
		✔ The cart was emptied
		✔ The order was sent to be processed asyncronously


Tests done!

@julianocosta89 julianocosta89 merged commit 880f79c into open-telemetry:main Jan 28, 2025
31 checks passed
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.

2 participants