Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/docs/astro-4.16.1
Browse files Browse the repository at this point in the history
  • Loading branch information
guzhongren authored Nov 20, 2024
2 parents 1f25770 + 287ed0c commit e37f540
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 65 deletions.
118 changes: 59 additions & 59 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,30 +52,30 @@ jobs:
--source="/path" \
-v --redact
security-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.head_ref }}
- name: Run Trivy vulnerability scanner in repo mode
uses: aquasecurity/trivy-action@master
with:
scan-type: "fs"
ignore-unfixed: true
exit-code: "1"
severity: "CRITICAL"
trivyignores: .trivyignore

- name: Run Trivy vulnerability scanner in IaC mode
uses: aquasecurity/trivy-action@master
with:
scan-type: "config"
exit-code: "1"
ignore-unfixed: true
severity: "CRITICAL"
trivyignores: .trivyignore
# security-check:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# with:
# fetch-depth: 0
# ref: ${{ github.head_ref }}
# - name: Run Trivy vulnerability scanner in repo mode
# uses: aquasecurity/trivy-action@master
# with:
# scan-type: "fs"
# ignore-unfixed: true
# exit-code: "1"
# severity: "CRITICAL"
# trivyignores: .trivyignore

# - name: Run Trivy vulnerability scanner in IaC mode
# uses: aquasecurity/trivy-action@master
# with:
# scan-type: "config"
# exit-code: "1"
# ignore-unfixed: true
# severity: "CRITICAL"
# trivyignores: .trivyignore
backend-check:
runs-on: ubuntu-latest
defaults:
Expand Down Expand Up @@ -245,39 +245,39 @@ jobs:
run: |
./ops/check.sh buildkite-status
images-check:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Build and tag
run: |
docker build -t frontend:latest ./ -f ./ops/infra/Dockerfile.frontend
docker build -t backend:latest ./ -f ./ops/infra/Dockerfile.backend
- name: Run Trivy vulnerability scanner for frontend
uses: aquasecurity/trivy-action@master
env:
TRIVY_DB_REPOSITORY: "public.ecr.aws/aquasecurity/trivy-db:2"
with:
image-ref: frontend:latest
format: "table"
exit-code: "1"
ignore-unfixed: true
severity: "CRITICAL,HIGH"
trivyignores: ".trivyignore"
- name: Run Trivy vulnerability scanner for backend
uses: aquasecurity/trivy-action@master
env:
TRIVY_DB_REPOSITORY: "public.ecr.aws/aquasecurity/trivy-db:2"
with:
image-ref: backend:latest
format: "table"
exit-code: "1"
ignore-unfixed: true
severity: "CRITICAL,HIGH"
trivyignores: ".trivyignore"
# images-check:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout repo
# uses: actions/checkout@v4

# - name: Build and tag
# run: |
# docker build -t frontend:latest ./ -f ./ops/infra/Dockerfile.frontend
# docker build -t backend:latest ./ -f ./ops/infra/Dockerfile.backend

# - name: Run Trivy vulnerability scanner for frontend
# uses: aquasecurity/trivy-action@master
# env:
# TRIVY_DB_REPOSITORY: "public.ecr.aws/aquasecurity/trivy-db:2"
# with:
# image-ref: frontend:latest
# format: "table"
# exit-code: "1"
# ignore-unfixed: true
# severity: "CRITICAL,HIGH"
# trivyignores: ".trivyignore"
# - name: Run Trivy vulnerability scanner for backend
# uses: aquasecurity/trivy-action@master
# env:
# TRIVY_DB_REPOSITORY: "public.ecr.aws/aquasecurity/trivy-db:2"
# with:
# image-ref: backend:latest
# format: "table"
# exit-code: "1"
# ignore-unfixed: true
# severity: "CRITICAL,HIGH"
# trivyignores: ".trivyignore"
deploy-infra:
if: ${{ github.ref == 'refs/heads/main' }}
needs:
Expand All @@ -289,8 +289,8 @@ jobs:
- frontend-type-check
- backend-check
- deny-dot-star-check
- security-check
- images-check
# - security-check
# - images-check
- shellcheck
- credential-check
- frontend-license-check
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ describe('MetricsStepper', () => {
});

it('should export json when click save button', async () => {
const expectedFileName = 'config';
const expectedFileName = `-Heartbeat`;
const expectedJson = {
board: undefined,
calendarType: Calendar.Regular,
Expand All @@ -345,7 +345,7 @@ describe('MetricsStepper', () => {
});

it('should export json when click save button when pipelineTool, sourceControl, and board is not empty', async () => {
const expectedFileName = 'config';
const expectedFileName = `-Heartbeat`;
const expectedJson = {
board: { boardId: '', email: '', site: '', token: '', type: 'Jira' },
calendarType: Calendar.Regular,
Expand All @@ -363,15 +363,15 @@ describe('MetricsStepper', () => {
};

setup();
await fillMetricsData();
fillMetricsData();

await userEvent.click(screen.getByText(SAVE));

expect(exportToJsonFile).toHaveBeenCalledWith(expectedFileName, expectedJson);
});

it('should export json file when click save button in metrics page given all content is empty', async () => {
const expectedFileName = 'config';
const expectedFileName = 'test-project-Name-Heartbeat';
const expectedJson = {
advancedSettings: null,
assigneeFilter: ASSIGNEE_FILTER_TYPES.LAST_ASSIGNEE,
Expand Down Expand Up @@ -423,7 +423,7 @@ describe('MetricsStepper', () => {
}, 50000);

it('should export json file when click save button in report page given all content is empty', async () => {
const expectedFileName = 'config';
const expectedFileName = 'test-project-Name-Heartbeat';
const expectedJson = {
advancedSettings: null,
assigneeFilter: ASSIGNEE_FILTER_TYPES.LAST_ASSIGNEE,
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/containers/MetricsStepper/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ const MetricsStepper = () => {
reworkTimesSettings: importedData.reworkTimesSettings,
};
const jsonData = activeStep === METRICS_STEPS.CONFIG ? configData : { ...configData, ...metricsData };
exportToJsonFile('config', jsonData);
exportToJsonFile(`${config.basic.projectName.split(' ').join('-')}-Heartbeat`, jsonData);
};

const handleNext = () => {
Expand Down

0 comments on commit e37f540

Please sign in to comment.