Skip to content

Commit

Permalink
Merge branch 'master' into 29871-implement-ux-design-for-enhanced-fil…
Browse files Browse the repository at this point in the history
…e-field
  • Loading branch information
nicobytes authored Sep 19, 2024
2 parents 2f37be4 + e483d1f commit 0119b89
Show file tree
Hide file tree
Showing 17 changed files with 408 additions and 4 deletions.
32 changes: 32 additions & 0 deletions .github/actions/core-cicd/api-limits-check/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Check GitHub API Rate Limit Action

This GitHub Action allows you to check the current API rate limits for your GitHub account by querying the `/rate_limit` endpoint of the GitHub API. The action outputs the full JSON response, including rate limits for core, search, GraphQL, and other GitHub API resources.

## Inputs

| Input | Description | Required | Default |
|--------|-------------|----------|---------|
| `token` | The GitHub token to authenticate the API request. | true | `${{ github.token }}` |

## Outputs

The action outputs the full JSON response from the `/rate_limit` endpoint directly to the workflow log.

## Usage

Here’s an example of how to use this action in a GitHub workflow:

```yaml
name: Check GitHub API Rate Limits

on:
workflow_dispatch:

jobs:
check-rate-limits:
runs-on: ubuntu-latest
steps:
- name: Check API Rate Limit
uses: your-repo/check-rate-limit-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
15 changes: 15 additions & 0 deletions .github/actions/core-cicd/api-limits-check/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: 'Check GitHub API Rate Limit'
description: 'Outputs information on GitHub API /rate_limit endpoint'

inputs:
token:
description: 'GitHub token to authenticate the API request'
required: true
default: ${{ github.token }}

runs:
using: "composite"
steps:
- run: |
curl -s -H "Authorization: token ${{ inputs.token }}" https://api.github.com/rate_limit
shell: bash
10 changes: 9 additions & 1 deletion .github/workflows/cicd_comp_finalize-phase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,4 +183,12 @@ jobs:
if [ "${{ needs.prepare-report-data.outputs.aggregate_status }}" != "SUCCESS" ]; then
echo "One or more jobs failed or cancelled!"
exit 1
fi
fi
# Check can be removed if we have resolved root cause
# We cannot use a local github action for this as it is run before we checkout the repo
# secrets.GITHUB_TOKEN is not available in composite workflows so it needs to be passed in.
- name: Check API Rate Limit
shell: bash
run: |
curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN}}" https://api.github.com/rate_limit || true
7 changes: 7 additions & 0 deletions .github/workflows/cicd_comp_initialize-phase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ jobs:
shell: bash
run: |
echo "Initializing..."
# Check can be removed if we have resolved root cause
# We cannot use a local github action for this as it is run before we checkout the repo
# secrets.GITHUB_TOKEN is not available in composite workflows so it needs to be passed in.
- name: Check API Rate Limit
shell: bash
run: |
curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/rate_limit || true
# This job checks for artifacts from previous builds and determines if they can be reused
check-previous-build:
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/cicd_comp_pr-notifier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,10 @@ jobs:
-d "{ \"channel\":\"${channel}\",\"text\":\"${message}\"}" \
-s \
https://slack.com/api/chat.postMessage
# Check can be removed if we have resolved root cause
# We cannot use a local github action for this as it is run before we checkout the repo
# secrets.GITHUB_TOKEN is not available in composite workflows so it needs to be passed in.
- name: Check API Rate Limit
shell: bash
run: |
curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/rate_limit || true
9 changes: 8 additions & 1 deletion .github/workflows/cicd_post-workflow-reporting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -271,4 +271,11 @@ jobs:
channel-id: ${{ vars.SLACK_REPORT_CHANNEL }}
payload: ${{ steps.prepare-slack-message.outputs.payload }}
json: true
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
# Check can be removed if we have resolved root cause
# We cannot use a local github action for this as it is run before we checkout the repo
# secrets.GITHUB_TOKEN is not available in composite workflows so it needs to be passed in.
- name: Check API Rate Limit
shell: bash
run: |
curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/rate_limit || true
2 changes: 2 additions & 0 deletions e2e/dotcms-e2e-node/frontend/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CI=false
BASE_URL=http://localhost:8080
1 change: 1 addition & 0 deletions e2e/dotcms-e2e-node/frontend/.env.ci
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CI=true
1 change: 1 addition & 0 deletions e2e/dotcms-e2e-node/frontend/.env.local
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
BASE_URL=http://localhost:4200
5 changes: 5 additions & 0 deletions e2e/dotcms-e2e-node/frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules/
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
15 changes: 15 additions & 0 deletions e2e/dotcms-e2e-node/frontend/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "frontend",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"devDependencies": {
"@playwright/test": "^1.47.0",
"@types/node": "^22.5.4",
"dotenv": "^16.4.5"
},
"scripts": {
"start-local": "CURRENT_ENV=local yarn playwright test",
"start-ci": "CURRENT_ENV=ci yarn playwright test"
}
}
68 changes: 68 additions & 0 deletions e2e/dotcms-e2e-node/frontend/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import dotenv from 'dotenv';
import * as path from "node:path";
import { defineConfig, devices } from '@playwright/test';

const resolveEnvs = () => {
const envFiles = ['.env'];

if (process.env.CURRENT_ENV === 'local') {
envFiles.push('.env.local');
} else if (process.env.CURRENT_ENV === 'ci') {
envFiles.push('.env.ci');
}

envFiles.forEach((file) => {
dotenv.config({
path: path.resolve(__dirname, file),
override: true
});
});
};

resolveEnvs();

/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: './tests',
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'html',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
baseURL: process.env.BASE_URL,
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
},
/* Configure projects for major browsers */
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},

{
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
},

{
name: 'webkit',
use: { ...devices['Desktop Safari'] },
},
],
webServer: {
command: 'nx serve dotcms-ui',
cwd: '../../../core-web',
url: process.env.BASE_URL + '/dotAdmin',
reuseExistingServer: !!process.env.CI,
}
});
8 changes: 8 additions & 0 deletions e2e/dotcms-e2e-node/frontend/tests/welcome.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { test, expect } from '@playwright/test';

test('has title', async ({ page }) => {
await page.goto('/dotAdmin');

// Expect h3 to contain a substring.
expect(await page.locator('h3').textContent()).toContain('Welcome!');
});
46 changes: 46 additions & 0 deletions e2e/dotcms-e2e-node/frontend/yarn.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


"@playwright/test@^1.47.0":
version "1.47.0"
resolved "https://registry.npmjs.org/@playwright/test/-/test-1.47.0.tgz#69fc55b10754147cc20021afbfa05747d4961bf0"
integrity sha512-SgAdlSwYVpToI4e/IH19IHHWvoijAYH5hu2MWSXptRypLSnzj51PcGD+rsOXFayde4P9ZLi+loXVwArg6IUkCA==
dependencies:
playwright "1.47.0"

"@types/node@^22.5.4":
version "22.5.4"
resolved "https://registry.npmjs.org/@types/node/-/node-22.5.4.tgz#83f7d1f65bc2ed223bdbf57c7884f1d5a4fa84e8"
integrity sha512-FDuKUJQm/ju9fT/SeX/6+gBzoPzlVCzfzmGkwKvRHQVxi4BntVbyIwf6a4Xn62mrvndLiml6z/UBXIdEVjQLXg==
dependencies:
undici-types "~6.19.2"

dotenv@^16.4.5:
version "16.4.5"
resolved "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz#cdd3b3b604cb327e286b4762e13502f717cb099f"
integrity sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==

[email protected]:
version "2.3.2"
resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a"
integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==

[email protected]:
version "1.47.0"
resolved "https://registry.npmjs.org/playwright-core/-/playwright-core-1.47.0.tgz#b54ec060fd83e5c2e46b63986b5ebb5e96ace427"
integrity sha512-1DyHT8OqkcfCkYUD9zzUTfg7EfTd+6a8MkD/NWOvjo0u/SCNd5YmY/lJwFvUZOxJbWNds+ei7ic2+R/cRz/PDg==

[email protected]:
version "1.47.0"
resolved "https://registry.npmjs.org/playwright/-/playwright-1.47.0.tgz#fb9b028883fad11362f9ff63ce7ba44bda0bf626"
integrity sha512-jOWiRq2pdNAX/mwLiwFYnPHpEZ4rM+fRSQpRHwEwZlP2PUANvL3+aJOF/bvISMhFD30rqMxUB4RJx9aQbfh4Ww==
dependencies:
playwright-core "1.47.0"
optionalDependencies:
fsevents "2.3.2"

undici-types@~6.19.2:
version "6.19.8"
resolved "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz#35111c9d1437ab83a7cdc0abae2f26d88eda0a02"
integrity sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==
Loading

0 comments on commit 0119b89

Please sign in to comment.