Skip to content

Added templates folder to support app.py for rendering UI - #14524

Open
raj-830 wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
SRT-ISV:apigee-ui-example
Open

Added templates folder to support app.py for rendering UI#14524
raj-830 wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
SRT-ISV:apigee-ui-example

Conversation

@raj-830

@raj-830 raj-830 commented Aug 19, 2026

Copy link
Copy Markdown

Description

Added templates folder to support app.py for rendering UI

Testing

Compliance & Style


Post-Approval Actions

  • Please merge this PR for me once it is approved

@raj-830
raj-830 requested review from a team as code owners August 19, 2026 11:10
@product-auto-label product-auto-label Bot added the samples Issues that are directly related to samples. label Aug 19, 2026
@snippet-bot

snippet-bot Bot commented Aug 19, 2026

Copy link
Copy Markdown

Here is the summary of possible violations 😱

Details

There are 2 possible violations for not having product prefix.

The end of the violation section. All the stuff below is FYI purposes only.


Here is the summary of changes.

You are about to add 2 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@google-cla

google-cla Bot commented Aug 19, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces two new HTML templates, page1.html and page2.html, for a Marketplace Integration UI flow. The feedback suggests improving the forms by replacing hardcoded action paths with Flask's url_for to ensure robust routing, and replacing pre-filled literal default values (PROJECT_ID and SERVICE_ACCOUNT) with the placeholder attribute to prevent accidental submissions of invalid placeholder data.

<div class="card" style="max-width: 550px;">
<h2>Step 1: Generate API</h2>

<form method="POST" action="/">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Using hardcoded paths like action="/" can break if the application is hosted under a subdirectory or behind a reverse proxy with path-based routing. It is highly recommended to use Flask's url_for to dynamically generate the form action URL.

        <form method="POST" action="{{ url_for('generate_api') }}">


<div class="form-group">
<label for="apigee_org">Apigee Organization (APIGEE_ORG)</label>
<input type="text" name="apigee_org" id="apigee_org" value="PROJECT_ID" required>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Using value="PROJECT_ID" pre-fills the input field with a literal placeholder string. If the user submits the form without modifying this field, the application will attempt to use the literal string "PROJECT_ID" as the Apigee organization, leading to API errors. Using the placeholder attribute instead of value ensures the field remains empty by default, allowing the required attribute to prevent accidental submissions of placeholder values.

                <input type="text" name="apigee_org" id="apigee_org" placeholder="PROJECT_ID" required>


<div class="form-group">
<label for="service_account">Service Account (For gcloud Impersonation)</label>
<input type="text" name="service_account" id="service_account" value="SERVICE_ACCOUNT" required>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Using value="SERVICE_ACCOUNT" pre-fills the input field with a literal placeholder string. If the user submits the form without modifying this field, the application will attempt to use the literal string "SERVICE_ACCOUNT" as the service account name, which will fail during gcloud impersonation. Using the placeholder attribute instead of value ensures the field remains empty by default, allowing the required attribute to prevent accidental submissions of placeholder values.

                <input type="text" name="service_account" id="service_account" placeholder="SERVICE_ACCOUNT" required>

<a href="{{ url_for('generate_api') }}" class="back-btn">&larr; Back to Step 1</a>
<h2>Apigee to ALM</h2>

<form method="POST" action="/deploy">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Using hardcoded paths like action="/deploy" can break if the application is hosted under a subdirectory or behind a reverse proxy with path-based routing. It is highly recommended to use Flask's url_for to dynamically generate the form action URL.

        <form method="POST" action="{{ url_for('deploy_page') }}">

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

Labels

samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant