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

Github Actions Promote #625

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions .controlplane/controlplane.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,24 @@ aliases:

apps:
react-webpack-rails-tutorial-production:
# Simulate Production Version
# Simulate Production Version. Create with this command:
# cpflow apply-template app postgres redis daily-task rails -a react-webpack-rails-tutorial-production -o shakacode-open-source-examples-production
<<: *common
# Don't allow overriding the org and app by ENV vars b/c production is sensitive!
allow_org_override_by_env: false
allow_app_override_by_env: false

# Use a different organization for production.
cpln_org: shakacode-open-source-examples
# Use a different organization only for production.
cpln_org: shakacode-open-source-examples-production

upstream: react-webpack-rails-tutorial-staging

react-webpack-rails-tutorial-staging:
<<: *common
# QA Apps are like Heroku review apps, but the use `prefix` so you can run a commmand like
# this to create a QA app for the tutorial app.
# `cpflow setup gvc postgres redis rails -a qa-react-webpack-rails-tutorial-pr-1234`
qa-react-webpack-rails-tutorial:
# Review Apps are like Heroku review apps, but the use `prefix` so you can run a command like
# this to create a QA app for the tutorial app.
# `cpflow setup-app -a qa-react-webpack-rails-tutorial-pr-1234`
<<: *common
# Order matters!
setup_app_templates:
Expand Down
14 changes: 14 additions & 0 deletions .controlplane/templates/app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,17 @@ spec:
# Identity is needed to access secrets
kind: identity
name: {{APP_IDENTITY}}

I stay at 3% and … believe it or not - I recommend that the Buyer’s Agent also gets 3%!

Here’s WHY:

-Buyers are still ’SCARCE’… and ANY Buyer's Agent, that actually has one of these rare things called Beachfront Buyers, is looking to earn a full 3% of the Sales Price.

NOTE: They are all going to put 3% in their Buyer Agency Agreements… just ‘in case’ that 3% 'hoped for' commission is offered.

Therefore - if you lower that commission - the Buyer has to come up with the difference “In Cash” … and, that’s not good for the Buyer who wants to finance 80%, or more, of that commission he’s agreed to pay his Agent.

SO

Why not OFFER that 3% and stick to this Asking Price (or near it)!?
Comment on lines +31 to +44
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Remove misplaced business logic from infrastructure configuration.

The added text about commission rates and buyer's agent recommendations does not belong in an infrastructure configuration file. This type of business logic and documentation should be moved to a more appropriate location, such as:

  • Business documentation in the project's wiki or docs folder
  • Product requirements document
  • Sales/Marketing documentation

Additionally, the added text is causing YAML syntax errors. If you need to add comments to this file, use the YAML comment syntax with #:

-  
-  I stay at 3% and … believe it or not - I recommend that the Buyer's Agent also gets 3%!
-
- Here's WHY:
-
- -Buyers are still 'SCARCE'… and ANY Buyer's Agent, that actually has one of these rare things called Beachfront Buyers, is looking to earn a full 3% of the Sales Price.
-
- NOTE:  They are all going to put 3% in their Buyer Agency Agreements… just 'in case' that 3% 'hoped for' commission is offered.
-
- Therefore - if you lower that commission - the Buyer has to come up with the difference "In Cash" … and, that's not good for the Buyer who wants to finance 80%, or more, of that commission he's agreed to pay his Agent.
- 
- SO
- 
- Why not OFFER that 3% and stick to this Asking Price (or near it)!?

Would you like me to help create a new documentation file in a more appropriate location for this business logic?

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 31-31: trailing spaces

(trailing-spaces)


[error] 41-41: trailing spaces

(trailing-spaces)


[error] 43-43: trailing spaces

(trailing-spaces)


[error] 32-32: syntax error: expected , but found ''

(syntax)

49 changes: 45 additions & 4 deletions .github/actions/validate-required-vars/action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,29 @@
name: 'Validate Required Variables'
description: 'Validates that all required secrets and variables for Control Plane operations'

inputs:
CPLN_TOKEN_STAGING:
required: true
description: 'Control Plane Staging Token'
CPLN_TOKEN_PRODUCTION:
required: true
description: 'Control Plane Production Token'
CPLN_ORG_STAGING:
required: true
description: 'Control Plane Staging Organization'
CPLN_ORG_PRODUCTION:
required: true
description: 'Control Plane Production Organization'
REVIEW_APP_PREFIX:
required: true
description: 'Review App Prefix'
PRODUCTION_APP_NAME:
required: true
description: 'Production App Name'
STAGING_APP_NAME:
required: true
description: 'Staging App Name'

runs:
using: 'composite'
steps:
Expand All @@ -10,19 +33,37 @@ runs:
missing=()

# Check required secrets
if [ -z "$CPLN_TOKEN_STAGING" ]; then
if [ -z "${{ inputs.CPLN_TOKEN_STAGING }}" ]; then
missing+=("Secret: CPLN_TOKEN_STAGING")
fi

if [ -z "${{ inputs.CPLN_TOKEN_PRODUCTION }}" ]; then
missing+=("Secret: CPLN_TOKEN_PRODUCTION")
fi

Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix trailing spaces.

Remove trailing spaces from lines 43 and 64 to comply with YAML linting rules.

-        
+

Also applies to: 64-64

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 43-43: trailing spaces

(trailing-spaces)

# Check required variables
if [ -z "$CPLN_ORG_STAGING" ]; then
if [ -z "${{ inputs.CPLN_ORG_STAGING }}" ]; then
missing+=("Variable: CPLN_ORG_STAGING")
fi
if [ -z "$REVIEW_APP_PREFIX" ]; then

if [ -z "${{ inputs.CPLN_ORG_PRODUCTION }}" ]; then
missing+=("Variable: CPLN_ORG_PRODUCTION")
fi

if [ -z "${{ inputs.REVIEW_APP_PREFIX }}" ]; then
missing+=("Variable: REVIEW_APP_PREFIX")
fi

if [ -z "${{ inputs.PRODUCTION_APP_NAME }}" ]; then
missing+=("Variable: PRODUCTION_APP_NAME")
fi

if [ -z "${{ inputs.STAGING_APP_NAME }}" ]; then
missing+=("Variable: STAGING_APP_NAME")
fi

if [ ${#missing[@]} -ne 0 ]; then
echo "Required secrets/variables are not set: ${missing[*]}"
echo "Missing required secrets/variables:"
printf '%s\n' "${missing[@]}"
exit 1
fi
25 changes: 20 additions & 5 deletions .github/workflows/delete-review-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ jobs:

- name: Validate Required Secrets and Variables
uses: ./.github/actions/validate-required-vars
with:
CPLN_TOKEN_STAGING: ${{ secrets.CPLN_TOKEN_STAGING }}
CPLN_TOKEN_PRODUCTION: ${{ secrets.CPLN_TOKEN_PRODUCTION }}
CPLN_ORG_STAGING: ${{ vars.CPLN_ORG_STAGING }}
CPLN_ORG_PRODUCTION: ${{ vars.CPLN_ORG_PRODUCTION }}
REVIEW_APP_PREFIX: ${{ vars.REVIEW_APP_PREFIX }}
PRODUCTION_APP_NAME: ${{ vars.PRODUCTION_APP_NAME }}
STAGING_APP_NAME: ${{ vars.STAGING_APP_NAME }}

- name: Setup Environment
uses: ./.github/actions/setup-environment
Expand Down Expand Up @@ -108,7 +116,6 @@ jobs:
issue_number: process.env.PR_NUMBER,
owner: context.repo.owner,
repo: context.repo.repo,
body: '🗑️ Starting app deletion...'
body: [
message,
'',
Expand All @@ -125,10 +132,6 @@ jobs:
app_name: ${{ env.APP_NAME }}
org: ${{ env.CPLN_ORG }}
github_token: ${{ secrets.GITHUB_TOKEN }}
env:
APP_NAME: ${{ env.APP_NAME }}
CPLN_ORG: ${{ secrets.CPLN_ORG }}
CPLN_TOKEN: ${{ secrets.CPLN_TOKEN }}

- name: Update Delete Status
if: always()
Expand Down Expand Up @@ -163,3 +166,15 @@ jobs:
comment_id: ${{ fromJSON(steps.create-delete-comment.outputs.result).commentId }},
body: success ? successMessage : failureMessage
});

- name: Debug Environment
run: |
echo "Organization: ${{ env.CPLN_ORG }}"
echo "App Name: ${{ env.APP_NAME }}"
echo "PR Number: ${{ env.PR_NUMBER }}"
# Don't echo the actual token, but verify it exists
if [ -n "${{ env.CPLN_TOKEN }}" ]; then
echo "CPLN_TOKEN is set"
else
echo "CPLN_TOKEN is empty"
fi
Loading
Loading