Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ [email protected]
DEBUG=true
INIT=true

GITHUB_API_TOKEN=replace-me
GITHUB_API_TOKEN=

# This is an environment variable that deletes all data in database on start up of the app.
# Its primary use is for deployment on remote development environment.
Expand Down
4 changes: 4 additions & 0 deletions apps/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,10 @@ def validate_ghcr_image(image: str):
else:
raise ValidationError("Could not recognise the GHCR owner. Please try again.")

# Return the image if the GitHub API token is missing
if settings.GITHUB_API_TOKEN in ["", None]:
return image

headers = {"Authorization": f"Bearer {settings.GITHUB_API_TOKEN}", "Accept": "application/vnd.github+json"}

try:
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/ui-tests/test-superuser-functionality.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ describe("Test superuser access", () => {
cy.get('input[name=name]').type(project_name)
cy.get("input[name=save]").should('be.visible').contains('Create project').click()
});
cy.wait(5000) // sometimes it takes a while to create a project but just waiting once at the end should be enough
cy.wait(10000) // sometimes it takes a while to create a project but just waiting once at the end should be enough

cy.logf("Check that it is still possible to click the button to create a new project", Cypress.currentTest)
cy.visit("/projects/")
Expand Down
18 changes: 14 additions & 4 deletions cypress/e2e/ui-tests/test-user-manage-apps.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -851,11 +851,21 @@ if (Cypress.env('create_resources') === true) {
cy.get('tr:contains("' + app_name + '")').find('a').contains('Settings').click()
cy.get('#id_image').type("-BAD")
cy.get('#submit-id-submit').should('be.visible').contains('Submit').click()
// Stay on the Settings page
cy.url().should("include", "/apps/settings")
// Back on project page
cy.url().should("not.include", "/apps/settings")
cy.get('h3').should('have.text', project_name);

// Verify that the input field has the error class
cy.get('#id_image').should('have.class', 'is-invalid');
verifyAppStatus(app_name, "", "public", "Changing")

// The final app status and latest user action:
// Wait for 5 seconds and check the app status again
// This relies on the k8s event listener
// Verify that the app status now equals Error
if (env_run_extended_k8s_checks === true) {
cy.wait(5000).then(() => {
verifyAppStatus(app_name, "Error", "public", "Changing")
})
}

// Edit Dash app: modify the app image back to a valid image
cy.logf("Editing the dash app settings field Image to a valid value", Cypress.currentTest)
Expand Down
Loading