Skip to content

Commit

Permalink
Merge branch 'main' into renovate/migrate-config
Browse files Browse the repository at this point in the history
  • Loading branch information
plyr4 authored Sep 19, 2024
2 parents ddc141c + b74718c commit 0369323
Show file tree
Hide file tree
Showing 48 changed files with 1,408 additions and 681 deletions.
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ VELA_API=http://localhost:8080
# default: 30
# VELA_MAX_BUILD_LIMIT=

# customize the max number of starlark exec steps that the UI will allow an admin to configure
#
# default: 99999
# VELA_MAX_STARLARK_EXEC_LIMIT=

# customize the set of repos that are allowed to use schedules
#
# default: *
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
key: cypress-${{ runner.os }}-bin-v2-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
cypress-${{ runner.os }}-bin-v2-
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
- uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version-file: '.nvmrc'

Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
key: cypress-${{ runner.os }}-bin-v2-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
cypress-${{ runner.os }}-bin-v2-
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
- uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version-file: '.nvmrc'

Expand Down Expand Up @@ -122,7 +122,7 @@ jobs:
key: cypress-${{ runner.os }}-bin-v2-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
cypress-${{ runner.os }}-bin-v2-
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
- uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version-file: '.nvmrc'

Expand Down Expand Up @@ -167,7 +167,7 @@ jobs:
key: cypress-${{ runner.os }}-bin-v2-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
cypress-${{ runner.os }}-bin-v2-
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
- uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version-file: '.nvmrc'

Expand Down Expand Up @@ -205,7 +205,7 @@ jobs:
key: ${{ runner.os }}-modules-v2-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-modules-v2-
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
- uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version-file: '.nvmrc'

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@23acc5c183826b7a8a97bce3cecc52db901f8251 # v3.25.10
uses: github/codeql-action/init@294a9d92911152fe08befb9ec03e240add280cb3 # v3.26.8
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -49,7 +49,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@23acc5c183826b7a8a97bce3cecc52db901f8251 # v3.25.10
uses: github/codeql-action/autobuild@294a9d92911152fe08befb9ec03e240add280cb3 # v3.26.8

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -63,4 +63,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@23acc5c183826b7a8a97bce3cecc52db901f8251 # v3.25.10
uses: github/codeql-action/analyze@294a9d92911152fe08befb9ec03e240add280cb3 # v3.26.8
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
key: ${{ runner.os }}-modules-v2-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-modules-v2-
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
- uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version-file: '.nvmrc'

Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.15.0
20.17.0
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM fholzer/nginx-brotli:v1.24.0@sha256:55b6e7e04fa7eaf1bb0be210b9ea106292686deab6349a6efb9b52d229b0e940
FROM fholzer/nginx-brotli:v1.26.2@sha256:54300ef5ddd64ea877bb363bf56c42a6f402089392b3b9b746e891193394b571

RUN apk update && \
apk add --no-cache ca-certificates && \
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.local
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM fholzer/nginx-brotli:v1.24.0@sha256:55b6e7e04fa7eaf1bb0be210b9ea106292686deab6349a6efb9b52d229b0e940
FROM fholzer/nginx-brotli:v1.26.2@sha256:54300ef5ddd64ea877bb363bf56c42a6f402089392b3b9b746e891193394b571

RUN apk update && \
apk add --no-cache ca-certificates && \
Expand Down
69 changes: 69 additions & 0 deletions cypress/fixtures/deployments_5.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
[
{
"id": 5051,
"number": 1,
"repo_id": 1,
"url": "https://github.com/github/octocat.git/deployments/5051",
"user": "user",
"commit": "ce729516b279c7d7e66012387b39a8c13463fac5",
"ref": "refs/heads/main",
"task": "deploy:vela",
"target": "production",
"description": "Deployment request from Vela",
"payload": {
"foo": "bar"
}
},
{
"id": 5052,
"number": 2,
"repo_id": 1,
"url": "https://github.com/github/octocat.git/deployments/5052",
"user": "user",
"commit": "ce729516b279c7d7e66012387b39a8c13463fac5",
"ref": "refs/heads/main",
"task": "deploy:vela",
"target": "production",
"description": "Deployment request from Vela",
"payload": {}
},
{
"id": 5053,
"number": 3,
"repo_id": 1,
"url": "https://github.com/github/octocat.git/deployments/5053",
"user": "user",
"commit": "ce729516b279c7d7e66012387b39a8c13463fac5",
"ref": "refs/heads/main",
"task": "deploy:vela",
"target": "production",
"description": "Deployment request from Vela",
"payload": {}
},
{
"id": 5054,
"number": 4,
"repo_id": 1,
"url": "https://github.com/github/octocat.git/deployments/5054",
"user": "user",
"commit": "ce729516b279c7d7e66012387b39a8c13463fac5",
"ref": "refs/heads/main",
"task": "deploy:vela",
"target": "production",
"description": "Deployment request from Vela",
"payload": {}
},
{
"id": 5055,
"number": 5,
"repo_id": 1,
"url": "https://github.com/github/octocat.git/deployments/5055",
"user": "user",
"commit": "ce729516b279c7d7e66012387b39a8c13463fac5",
"ref": "refs/heads/main",
"task": "deploy:vela",
"target": "production",
"description": "Deployment request from Vela",
"payload": {}
}
]
4 changes: 2 additions & 2 deletions cypress/fixtures/services_5.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
"number": 2,
"name": "service-b",
"stage": "",
"status": "success",
"status": "running",
"error": "",
"exit_code": 2,
"created": 1572029883,
"started": 1572029928,
"finished": 1572029935,
"finished": 0,
"host": "",
"runtime": "docker",
"distribution": "linux"
Expand Down
4 changes: 2 additions & 2 deletions cypress/fixtures/steps_5.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
"number": 2,
"name": "build",
"stage": "",
"status": "success",
"status": "running",
"error": "",
"exit_code": 2,
"created": 1572029883,
"started": 1572029928,
"finished": 1572029935,
"finished": 0,
"host": "",
"runtime": "docker",
"distribution": "linux"
Expand Down
63 changes: 63 additions & 0 deletions cypress/fixtures/user_dashboards.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
[
{
"dashboard": {
"id": "6e26a6d0-2fc3-4531-a04d-678a58135288",
"name": "demo dashboard",
"created_at": 1726757028,
"created_by": "CookieCat",
"updated_at": 1726757028,
"updated_by": "CookieCat",
"admins": [
{
"id": 1,
"name": "CookieCat",
"active": true
}
],
"repos": [
{
"id": 1,
"name": "github/repo1"
}
]
},
"repos": [
{
"org": "github",
"name": "repo1",
"counter": 1,
"active": true,
"builds": [
{
"number": 1,
"started": 1726757097,
"sender": "CookieCat",
"ref": "refs/heads/main",
"status": "running",
"event": "push",
"branch": "master",
"link": "http://vela.example.com/github/repo1/1"
}
]
}
]
},
{
"dashboard": {
"id": "c4e8f563-4784-4b4b-9534-3007d579dc2a",
"name": "another demo dashboard",
"created_at": 1726757636,
"created_by": "CookieCat",
"updated_at": 1726757636,
"updated_by": "CookieCat",
"admins": [
{
"id": 1,
"name": "CookieCat",
"active": true
}
],
"repos": []
}
}
]
61 changes: 50 additions & 11 deletions cypress/integration/dashboards.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,56 @@
*/

context('Dashboards', () => {
context('main dashboards page', () => {
beforeEach(() => {
cy.server();
cy.route(
'GET',
'*api/v1/user/dashboards',
'fixture:user_dashboards.json',
);
cy.login('/dashboards');
});

it('shows the list of dashboards', () => {
cy.get('[data-test=dashboard-item]').should('have.length', 2);
});

it('shows the repos within a dashboard', () => {
cy.get('[data-test=dashboard-repos]').first().contains('github/repo1');
});

it('shows a message when there are no repos', () => {
cy.get('[data-test=dashboard-repos]')
.eq(1)
.contains('No repositories in this dashboard');
});

it('clicking dashoard name navigates to dashboard page', () => {
cy.get('[data-test=dashboard-item]')
.first()
.within(() => {
cy.get('a').first().click();
cy.location('pathname').should(
'eq',
'/dashboards/6e26a6d0-2fc3-4531-a04d-678a58135288',
);
});
});
});

context('main dashboards page shows message', () => {
beforeEach(() => {
cy.server();
cy.route(
'GET',
'*api/v1/user/dashboards',
'fixture:user_dashboards.json',
);
cy.login('/dashboards');
});
});

context('server returns dashboard with 3 cards, one without builds', () => {
beforeEach(() => {
cy.server();
Expand Down Expand Up @@ -112,15 +162,4 @@ context('Dashboards', () => {
);
});
});

context('main dashboards page shows message', () => {
beforeEach(() => {
cy.server();
cy.login('/dashboards');
});

it('shows the welcome message', () => {
cy.get('[data-test=dashboards]').contains('Welcome to dashboards!');
});
});
});
Loading

0 comments on commit 0369323

Please sign in to comment.