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

feat(scheduled builds): Add UI for scheduled builds proposal #660

Merged
merged 34 commits into from
Jun 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
fedce07
add routes
jchristensen5k May 3, 2023
7e9b3b6
initial plubing
jchristensen5k May 3, 2023
aa12b5f
still not working
jchristensen5k May 3, 2023
1c20d86
add some todos
jchristensen5k May 3, 2023
03da5de
still not workin
jchristensen5k May 3, 2023
ade73c3
it builds
jchristensen5k May 4, 2023
0b821a1
more todos
jchristensen5k May 4, 2023
022822c
api call happends and tab is clickable
jchristensen5k May 4, 2023
e951d07
empty list
jchristensen5k May 4, 2023
a8d8e84
form loads
jchristensen5k May 4, 2023
3134558
able to add and view schedules
jchristensen5k May 4, 2023
5d0ceda
use table view
jchristensen5k May 5, 2023
b91ccfa
remove unused code
jchristensen5k May 5, 2023
0f8aa0c
add toast when add is success
jchristensen5k May 5, 2023
cf9af86
use name not id
jchristensen5k May 5, 2023
54cbef0
get add/update to load correctly
jchristensen5k May 8, 2023
8370b06
add delete... stange but happens during 2nd delete
jchristensen5k May 8, 2023
43c0554
add some margin below each form field
jchristensen5k May 8, 2023
4b2ae31
elm-format
jchristensen5k May 8, 2023
52da769
linting
jchristensen5k May 19, 2023
444793f
add commands
jchristensen5k May 26, 2023
4c511af
Merge branch 'main' into feature/schedules
JayCeeJr May 26, 2023
e03903e
elm format
jchristensen5k May 26, 2023
efccf35
address inital feedback
jchristensen5k May 30, 2023
019cd9e
address inital feedback
jchristensen5k May 30, 2023
0784f4a
address inital feedback
jchristensen5k May 30, 2023
31a4601
address inital feedback
jchristensen5k May 30, 2023
4052641
address PR feedback
jchristensen5k May 31, 2023
30ed494
add AddSchedule page
jchristensen5k May 31, 2023
b736f58
add VELA_SCHEDULE_ALLOWLIST: '*' to docker-compose.yml
jchristensen5k May 31, 2023
354dbdc
add tests
jchristensen5k Jun 7, 2023
6f566e3
lint
jchristensen5k Jun 7, 2023
09788f0
fix comments
jchristensen5k Jun 8, 2023
839d9b3
format
jchristensen5k Jun 8, 2023
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
36 changes: 36 additions & 0 deletions cypress/fixtures/schedule.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"id": 1,
"active": true,
"name": "Daily",
"entry": "0 0 * * *",
"created_at": 1685037152,
"created_by": "CookieCat",
"updated_at": 1685037152,
"updated_by": "CookieCat",
"scheduled_at": 0,
"repo": {
"id": 1,
"user_id": 1,
"org": "CookieCat",
"name": "octocat",
"full_name": "github/octocat",
"link": "https://github.com/github/octocat",
"clone": "https://github.com/github/octocat.git",
"branch": "master",
"topics": [],
"build_limit": 10,
"timeout": 30,
"counter": 0,
"visibility": "public",
"private": false,
"trusted": false,
"active": true,
"allow_pull": true,
"allow_push": true,
"allow_deploy": true,
"allow_tag": true,
"allow_comment": true,
"pipeline_type": "yaml",
"previous_name": ""
}
}
74 changes: 74 additions & 0 deletions cypress/fixtures/schedules.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
[
{
"id": 1,
"active": true,
"name": "Daily",
"entry": "0 0 * * *",
"created_at": 1685037152,
"created_by": "CookieCat",
"updated_at": 1685037152,
"updated_by": "CookieCat",
"scheduled_at": 0,
"repo": {
"id": 1,
"user_id": 1,
"org": "CookieCat",
"name": "octocat",
"full_name": "github/octocat",
"link": "https://github.com/github/octocat",
"clone": "https://github.com/github/octocat.git",
"branch": "master",
"topics": [],
"build_limit": 10,
"timeout": 30,
"counter": 0,
"visibility": "public",
"private": false,
"trusted": false,
"active": true,
"allow_pull": true,
"allow_push": true,
"allow_deploy": true,
"allow_tag": true,
"allow_comment": true,
"pipeline_type": "yaml",
"previous_name": ""
}
},
{
"id": 2,
"active": true,
"name": "Hourly",
"entry": "30 * * * *",
"created_at": 1685037182,
"created_by": "CookieCat",
"updated_at": 1685037182,
"updated_by": "CookieCat",
"scheduled_at": 0,
"repo": {
"id": 1,
"user_id": 1,
"org": "CookieCat",
"name": "octocat",
"full_name": "github/octocat",
"link": "https://github.com/github/octocat",
"clone": "https://github.com/github/octocat.git",
"branch": "master",
"topics": [],
"build_limit": 10,
"timeout": 30,
"counter": 0,
"visibility": "public",
"private": false,
"trusted": false,
"active": true,
"allow_pull": true,
"allow_push": true,
"allow_deploy": true,
"allow_tag": true,
"allow_comment": true,
"pipeline_type": "yaml",
"previous_name": ""
}
}
]
9 changes: 9 additions & 0 deletions cypress/integration/repo.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,15 @@ context('Repo', () => {
cy.location('pathname').should('eq', '/github/octocat/settings');
});
});
context('click schedules in nav tabs', () => {
beforeEach(() => {
cy.get('[data-test=jump-Schedules]').click();
});

it('loads repo schedules', () => {
cy.location('pathname').should('eq', '/github/octocat/schedules');
});
});
context('click audit in nav tabs, again', () => {
beforeEach(() => {
cy.get('[data-test=jump-Audit]').click();
Expand Down
28 changes: 28 additions & 0 deletions cypress/integration/schedule.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright (c) 2022 Target Brands, Inc. All rights reserved.
* Use of this source code is governed by the LICENSE file in this repository.
*/

context('Schedule', () => {
context('server returning schedule', () => {
beforeEach(() => {
cy.server();
cy.route(
'GET',
'*api/v1/schedules/github/octocat/Daily',
'fixture:schedule.json',
);
cy.login('/github/octocat/schedules/Daily');
});
it('Add Schedule should work as intended', () => {
cy.get('[id=schedule-name]')
.should('exist')
.should('have.value', 'Daily');
cy.get('[id=schedule-entry]')
.should('exist')
.should('have.value', '0 0 * * *');
cy.get('[data-test=schedule-update-button]').should('exist');
cy.get('[data-test=schedule-delete-button]').should('exist');
});
});
});
25 changes: 25 additions & 0 deletions cypress/integration/schedules.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright (c) 2022 Target Brands, Inc. All rights reserved.
* Use of this source code is governed by the LICENSE file in this repository.
*/

context('Schedules', () => {
context('server returning schedules', () => {
beforeEach(() => {
cy.server();
cy.route(
'GET',
'*api/v1/schedules/github/octocat',
'fixture:schedules.json',
);
cy.login('/github/octocat/schedules');
});

it('Add Schedule button should exist', () => {
cy.get('[data-test=add-repo-schedule]').should('exist').contains('Add');
});
it('schedules table should show 2 rows', () => {
cy.get('[data-test=schedules-row]').should('have.length', 2);
});
});
});
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ services:
VELA_DISABLE_WEBHOOK_VALIDATION: 'true'
VELA_ENABLE_SECURE_COOKIE: 'false'
VELA_REPO_ALLOWLIST: '*'
VELA_SCHEDULE_ALLOWLIST: '*'
env_file:
- .env
restart: always
Expand Down
144 changes: 144 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
"cypress": "5.6.0",
"cypress-axe": "0.14.0",
"elm": "0.19.1-5",
"elm-format": "0.8.7",
"elm-test": "0.19.1-revision12",
"make-dir-cli": "3.0.0",
"ncp": "2.0.0",
"parcel": "2.8.3",
Expand Down Expand Up @@ -58,6 +60,7 @@
"lint:css": "stylelint --cache --cache-location 'node_modules/' 'src/scss/**/*.scss'",
"lint:css-fix": "npm run lint:css -- --fix",
"lint:elm": "elm-format --validate src/ tests/",
"lint:elm-fix": "elm-format --yes src/ tests/",
"lint:fix": "npm run lint:css-fix && npm run lint:prettier-fix",
"lint": "npm run lint:css && npm run lint:prettier"
},
Expand Down
Loading