Skip to content
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
1383c35
initial commit
tkotthakota-adobe Jun 11, 2025
8337409
refactor
tkotthakota-adobe Jun 13, 2025
b266957
add npm debug
tkotthakota-adobe Jun 13, 2025
50822a8
fix to ci.yaml
tkotthakota-adobe Jun 13, 2025
849d474
removed unused packages
tkotthakota-adobe Jun 13, 2025
7becf6c
fix index.js
tkotthakota-adobe Jun 14, 2025
57f9d9a
update readme
tkotthakota-adobe Jun 14, 2025
d764aa7
fresh npm install
tkotthakota-adobe Jun 16, 2025
2ce2706
adjust message reading logic
tkotthakota-adobe Jun 18, 2025
422b083
change secrets path
tkotthakota-adobe Jun 19, 2025
65513d7
resolve to right secrets name
tkotthakota-adobe Jun 19, 2025
078895a
fix api calls
tkotthakota-adobe Jun 19, 2025
f1fca92
fix slack message
tkotthakota-adobe Jun 19, 2025
67d3ba6
refactor + add opportunity status task processor
tkotthakota-adobe Jun 20, 2025
60d0f9b
use right api for to get suggestions
tkotthakota-adobe Jun 20, 2025
1471437
tweaks
tkotthakota-adobe Jun 20, 2025
c640c0a
adjust slack messages
tkotthakota-adobe Jun 20, 2025
58c6899
incorporate review comments
tkotthakota-adobe Jun 20, 2025
087da0c
tweak message
tkotthakota-adobe Jun 20, 2025
cc9d2ee
combine messages
tkotthakota-adobe Jun 20, 2025
67a1422
add each opportunity in a new line
tkotthakota-adobe Jun 20, 2025
db143d5
test files todo
tkotthakota-adobe Jun 20, 2025
1c16de6
add tests
tkotthakota-adobe Jun 24, 2025
5793d93
increase the coverage limits
tkotthakota-adobe Jun 24, 2025
5e3eb12
review comments
tkotthakota-adobe Jun 27, 2025
6d84d84
Revert "review comments"
tkotthakota-adobe Jun 27, 2025
be82400
address review comments
tkotthakota-adobe Jul 7, 2025
cb1e02b
point to task manager secrets managher
tkotthakota-adobe Jul 7, 2025
51b73bc
pass slack tokens from api service
tkotthakota-adobe Jul 8, 2025
ad782cc
Revert "pass slack tokens from api service"
tkotthakota-adobe Jul 8, 2025
2554042
fix name missing issue
tkotthakota-adobe Jul 8, 2025
28a5501
experience url fix
tkotthakota-adobe Jul 8, 2025
3c68ee3
fix test
tkotthakota-adobe Jul 8, 2025
8539d7b
use imsOrgId for mapping
tkotthakota-adobe Jul 8, 2025
6dd366a
review comments addressed
tkotthakota-adobe Jul 8, 2025
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
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.vscode/*
coverage/*
scripts/*
36 changes: 36 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright 2025 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/

module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
},
extends: [
'@adobe/helix',
'plugin:@typescript-eslint/recommended',
],
plugins: [
'import',
'@typescript-eslint',
],
overrides: [
{
files: ['*.test.js'],
rules: {
'@typescript-eslint/no-unused-expressions': 'off',
},
},
],
};
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Bug report
about: Create a report to help us improve
labels: bug

---

**Description**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Version:**
run: `$ hlx --version`

**Additional context**
Add any other context about the problem here.
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE/discussion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: Discussion
about: Start a new discussion
labels: question

---

## Overview
whats' this discussion about?

## Details
more details

## Proposed Actions
and now?
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: Feature request
about: Suggest an idea for this project
labels: enhancement

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
29 changes: 29 additions & 0 deletions .github/actions/configure-aws/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "Set up AWS Credentials and Fetch Secrets"
description: "Configures AWS credentials for use in subsequent steps. Fetches secrets from AWS Secrets Manager."

inputs:
aws_role_to_assume:
description: "ARN of the IAM role to assume"
default: "arn:aws:iam::682033462621:role/spacecat-role-github-actions"
required: true
secret_ids:
description: "List of secret IDs to fetch from AWS Secrets Manager"
default: |
/spacecat/github-actions
required: true

runs:
using: "composite"
steps:
- name: Configure AWS Credentials
id: creds
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-east-1
role-to-assume: ${{ inputs.aws_role_to_assume }}

- name: Fetch AWS Secrets
uses: aws-actions/aws-secretsmanager-get-secrets@v2
with:
parse-json-secrets: true
secret-ids: ${{ inputs.secret_ids }}
29 changes: 29 additions & 0 deletions .github/actions/lint-test-coverage/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "Lint, Test, and Coverage"
description: "Runs lint and test commands, plus coverage"

inputs:
codecov_token:
description: "Codecov Token (optional)"
required: false
default: ""
upload_coverage:
description: "Whether to upload coverage to Codecov (true/false). Default false."
required: false
default: "false"

runs:
using: "composite"
steps:
- name: Lint
run: npm run lint
shell: bash

- name: Test
run: npm run test
shell: bash

- name: Upload coverage to Codecov
if: ${{ inputs.upload_coverage == 'true' }}
uses: codecov/codecov-action@v5
with:
token: ${{ inputs.codecov_token }}
32 changes: 32 additions & 0 deletions .github/actions/setup-node-npm/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: "Setup Node & NPM (with cache)"
description: "Checks out code, sets up Node, uses NPM cache, installs dependencies"

runs:
using: "composite"
steps:
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 22.12

- name: Get npm cache directory
id: npm-cache-dir
run: echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT
shell: bash

- name: Set up NPM Cache
uses: actions/cache@v4
id: npm-cache
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- name: Update NPM (only if cache miss)
run: npm install -g [email protected]
shell: bash

- name: Install dependencies (only if cache miss)
run: npm ci
shell: bash
8 changes: 8 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Please ensure your pull request adheres to the following guidelines:
- [ ] make sure to link the related issues in this description
- [ ] when merging / squashing, make sure the fixed issue references are visible in the commits, for easy compilation of release notes

## Related Issues


Thanks for contributing!
137 changes: 137 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
name: Build

permissions:
id-token: write
contents: write
issues: read

on: [push]

env:
CI_BUILD_NUM: ${{ github.run_id }}
CI_BRANCH: ${{ github.ref_name }}
HLX_AWS_REGION: ${{ secrets.AWS_REGION }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4
with:
persist-credentials: 'false'
- name: Setup Node & NPM
uses: ./.github/actions/setup-node-npm

- name: Lint, Test, Coverage Upload
uses: ./.github/actions/lint-test-coverage
with:
upload_coverage: "true"
codecov_token: ${{ secrets.CODECOV_TOKEN }}

- name: Semantic Release (Dry Run)
if: github.ref != 'refs/heads/main'
run: npm run semantic-release-dry
env:
GITHUB_TOKEN: ${{ secrets.ADOBE_BOT_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.ADOBE_BOT_NPM_TOKEN }}

- name: Print npm debug log if build fails
if: failure()
run: |
if [ -f /home/runner/.npm/_logs/*.log ]; then
echo "==== NPM DEBUG LOG ===="
find /home/runner/.npm/_logs -name '*.log' -exec cat {} \;
echo "==== END NPM DEBUG LOG ===="
else
echo "No npm debug log found."
fi

- name: Clean npm cache
run: npm cache clean --force

- name: Create empty cache directory
run: mkdir -p /tmp/empty-cache

- name: Install dependencies
run: npm ci --cache /tmp/empty-cache

semantic-release:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main'
steps:
- name: Check out
uses: actions/checkout@v4
with:
persist-credentials: 'false'

- name: Configure Environment
run: echo -e "LOG_LEVEL=info\n" > .env

- name: Setup Node & NPM
uses: ./.github/actions/setup-node-npm

- name: Configure AWS
uses: ./.github/actions/configure-aws
with:
aws_role_to_assume: 'arn:aws:iam::${{secrets.AWS_ACCOUNT_ID_PROD}}:role/spacecat-role-github-actions'

- name: Semantic Release
run: npm run semantic-release
env:
GITHUB_TOKEN: ${{ secrets.ADOBE_BOT_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.ADOBE_BOT_NPM_TOKEN }}
AWS_REGION: us-east-1
AWS_ACCOUNT_ID: ${{secrets.AWS_ACCOUNT_ID_PROD}}

deploy-stage:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main'
steps:
- name: Check out
uses: actions/checkout@v4
with:
persist-credentials: 'false'

- name: Setup Node & NPM
uses: ./.github/actions/setup-node-npm

- name: Configure AWS for STAGE
uses: ./.github/actions/configure-aws
with:
aws_role_to_assume: 'arn:aws:iam::${{secrets.AWS_ACCOUNT_ID_STAGE}}:role/spacecat-role-github-actions'

- name: Branch Deployment
run: npm run deploy-stage
env:
AWS_REGION: us-east-1
AWS_ACCOUNT_ID: ${{secrets.AWS_ACCOUNT_ID_STAGE}}


branch-deploy:
runs-on: ubuntu-latest
needs: build
if: github.ref != 'refs/heads/main'
steps:
- name: Check out
uses: actions/checkout@v4
with:
persist-credentials: 'false'

- name: Setup Node & NPM
uses: ./.github/actions/setup-node-npm

- name: Configure AWS
uses: ./.github/actions/configure-aws
with:
aws_role_to_assume: 'arn:aws:iam::${{secrets.AWS_ACCOUNT_ID_DEV}}:role/spacecat-role-github-actions'

- name: Branch Deployment
run: npm run deploy-dev
env:
AWS_REGION: us-east-1
AWS_ACCOUNT_ID: ${{secrets.AWS_ACCOUNT_ID_DEV}}

- name: Post-Deployment Integration Test
run: npm run test-postdeploy
15 changes: 15 additions & 0 deletions .github/workflows/semver-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
on:
push:
branches-ignore:
- 'main'

jobs:
ci_trigger:
runs-on: ubuntu-latest
name: Comment Semantic Release Status
steps:
- name: Comment
id: comment
uses: adobe-rnd/github-semantic-release-comment-action@master
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
coverage
.nyc_output/
node_modules/
junit
dist
tmp
logs
.DS_Store
test-results.xml
.env
.idea/
.vscode/
.aws-sam/
env.sh
output.txt
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
npx lint-staged

17 changes: 17 additions & 0 deletions .jsdoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"plugins": [],
"recurseDepth": 10,
"source": {
"includePattern": ".+\\.js(doc|x)?$",
"excludePattern": "(^|\\/|\\\\)_"
},
"sourceType": "module",
"tags": {
"allowUnknownTags": true,
"dictionaries": ["jsdoc","closure"]
},
"templates": {
"cleverLinks": false,
"monospaceLinks": false
}
}
Loading