From c089760225e502f9628e00e89a40658686a3c5e4 Mon Sep 17 00:00:00 2001 From: Sal Tijerina Date: Mon, 11 Dec 2023 12:35:33 -0600 Subject: [PATCH 1/5] use archiveSystemId set in app definition as default (#917) --- .../src/components/Applications/AppForm/AppForm.jsx | 11 ++++++++--- .../components/Applications/AppForm/AppForm.test.js | 11 ++++++++++- .../AppForm/fixtures/AppForm.app.fixture.js | 2 +- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/client/src/components/Applications/AppForm/AppForm.jsx b/client/src/components/Applications/AppForm/AppForm.jsx index e90801b4a..df1b4b2c2 100644 --- a/client/src/components/Applications/AppForm/AppForm.jsx +++ b/client/src/components/Applications/AppForm/AppForm.jsx @@ -274,7 +274,7 @@ export const AppSchemaForm = ({ app }) => { coresPerNode: app.definition.jobAttributes.coresPerNode, maxMinutes: app.definition.jobAttributes.maxMinutes, archiveSystemId: - defaultSystem || app.definition.jobAttributes.archiveSystemId, + app.definition.jobAttributes.archiveSystemId || defaultSystem, archiveSystemDir: app.definition.jobAttributes.archiveSystemDir, archiveOnAppError: true, appId: app.definition.id, @@ -785,14 +785,19 @@ export const AppSchemaForm = ({ app }) => { description="System into which output files are archived after application execution." name="archiveSystemId" type="text" - placeholder={defaultSystem} + placeholder={ + app.definition.archiveSystemId || defaultSystem + } /> ) : null} diff --git a/client/src/components/Applications/AppForm/AppForm.test.js b/client/src/components/Applications/AppForm/AppForm.test.js index 2a6b119df..a70c63263 100644 --- a/client/src/components/Applications/AppForm/AppForm.test.js +++ b/client/src/components/Applications/AppForm/AppForm.test.js @@ -72,11 +72,20 @@ describe('AppSchemaForm', () => { ...initialMockState, }); - const { getByText } = renderAppSchemaFormComponent(store, { + const { getByText, container } = renderAppSchemaFormComponent(store, { ...helloWorldAppFixture, }); + + const archiveSystemId = container.querySelector( + 'input[name="archiveSystemId"]' + ); await waitFor(() => { expect(getByText(/TACC-ACI/)).toBeDefined(); + + // use app definition default archive system + expect(archiveSystemId.value).toBe( + helloWorldAppFixture.definition.jobAttributes.archiveSystemId + ); }); }); diff --git a/client/src/components/Applications/AppForm/fixtures/AppForm.app.fixture.js b/client/src/components/Applications/AppForm/fixtures/AppForm.app.fixture.js index 1458448ea..263cb67e2 100644 --- a/client/src/components/Applications/AppForm/fixtures/AppForm.app.fixture.js +++ b/client/src/components/Applications/AppForm/fixtures/AppForm.app.fixture.js @@ -26,7 +26,7 @@ export const helloWorldAppFixture = { execSystemInputDir: '${JobWorkingDir}', execSystemOutputDir: '${JobWorkingDir}/output', execSystemLogicalQueue: 'development', - archiveSystemId: 'cloud.data', + archiveSystemId: 'frontera', archiveSystemDir: 'HOST_EVAL($HOME)/tapis-jobs-archive/${JobCreateDate}/${JobName}-${JobUUID}', archiveOnAppError: true, From 4f511f5150cc3c7fbf7948b2de571d40833da48e Mon Sep 17 00:00:00 2001 From: Chandra Y Date: Mon, 11 Dec 2023 13:15:15 -0600 Subject: [PATCH 2/5] Changelog for hotfix 3.4.3 --- CHANGELOG.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ac4e7c3a..9e594b724 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [3.4.3] - 2023-12-11: Fix push key handling +### Fixed + +- WP-408: use archiveSystemId set in app definition as default (#917) + + ## [3.4.2] - 2023-12-07: Fix push key handling ### Fixed @@ -1019,7 +1025,8 @@ WP-306: Fix target path regression (#871) ## [1.0.0] - 2020-02-28 v1.0.0 Production release as of Feb 28, 2020. -[unreleased]: https://github.com/TACC/Core-Portal/compare/v3.4.2...HEAD +[unreleased]: https://github.com/TACC/Core-Portal/compare/v3.4.3...HEAD +[3.4.3]: https://github.com/TACC/Core-Portal/releases/tag/v3.4.3 [3.4.2]: https://github.com/TACC/Core-Portal/releases/tag/v3.4.2 [3.4.1]: https://github.com/TACC/Core-Portal/releases/tag/v3.4.1 [3.4.0]: https://github.com/TACC/Core-Portal/releases/tag/v3.4.0 From dda1cc78eac737a623c8966f0e16de03bd9bb7bc Mon Sep 17 00:00:00 2001 From: Asim Regmi <54924215+asimregmi@users.noreply.github.com> Date: Mon, 11 Dec 2023 13:52:51 -0600 Subject: [PATCH 3/5] Task/WP-358: sort apps inside category before rendering (#914) * sort apps inside category before rendering --------- Co-authored-by: Sal Tijerina Co-authored-by: Chandra Y --- server/portal/apps/workspace/api/views.py | 1 + 1 file changed, 1 insertion(+) diff --git a/server/portal/apps/workspace/api/views.py b/server/portal/apps/workspace/api/views.py index bec3f5b35..406ad7d96 100644 --- a/server/portal/apps/workspace/api/views.py +++ b/server/portal/apps/workspace/api/views.py @@ -459,6 +459,7 @@ def getPublicApps(self, user): categoryResult["apps"].append(app) + categoryResult["apps"] = sorted(categoryResult["apps"], key=lambda app: app['label'] or app['appId']) categories.append(categoryResult) return categories, html_definitions From 700c52f9f5cdb5f3f5a4a3a55a98c6f104e108ca Mon Sep 17 00:00:00 2001 From: Taylor Grafft Date: Tue, 12 Dec 2023 14:20:59 -0600 Subject: [PATCH 4/5] task/WP-367: Adding Public Data CMS Nav and fixing search bar root bug (#918) * task/WP-367: Adding Public Data CMS Nav and fixing search bar root bug * refactoring section name code for readability --------- Co-authored-by: Taylor Grafft Co-authored-by: Taylor Grafft Co-authored-by: Sal Tijerina --- .../DataFilesListing/DataFilesListing.jsx | 31 +++++++++++++++---- .../src/components/PublicData/PublicData.jsx | 6 ++-- 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/client/src/components/DataFiles/DataFilesListing/DataFilesListing.jsx b/client/src/components/DataFiles/DataFilesListing/DataFilesListing.jsx index 2abd8e6a0..53d2e2616 100644 --- a/client/src/components/DataFiles/DataFilesListing/DataFilesListing.jsx +++ b/client/src/components/DataFiles/DataFilesListing/DataFilesListing.jsx @@ -153,13 +153,32 @@ const DataFilesListing = ({ api, scheme, system, path, isPublic }) => { const systemDisplayName = useSystemDisplayName({ scheme, system, path }); const homeDir = selectedSystem?.homeDir; - // Check if the current path is the home directory itself - const isAtHomeDir = path.replace(/^\/+/, '') === homeDir?.replace(/^\/+/, ''); + // Check if the current path is the root directory + const isRootDir = path === '/' || path === ''; - // Determine the sectionName based on the path (if homeDir, use systemDisplayName--else use current dir) - const sectionName = isAtHomeDir - ? systemDisplayName - : getCurrentDirectory(path); + // Adjusted check for home directory + const isAtHomeDir = + isRootDir || path.replace(/^\/+/, '') === homeDir?.replace(/^\/+/, ''); + + // Determine the sectionName with added handling for root directory + function determineSectionName( + isAtHomeDir, + isRootDir, + systemDisplayName, + path + ) { + if (isAtHomeDir) { + return isRootDir ? 'Root' : systemDisplayName; + } + return getCurrentDirectory(path); + } + + const sectionName = determineSectionName( + isAtHomeDir, + isRootDir, + systemDisplayName, + path + ); return ( <> diff --git a/client/src/components/PublicData/PublicData.jsx b/client/src/components/PublicData/PublicData.jsx index 40724764f..fa5e76da3 100644 --- a/client/src/components/PublicData/PublicData.jsx +++ b/client/src/components/PublicData/PublicData.jsx @@ -18,6 +18,8 @@ import DataFilesShowPathModal from '../DataFiles/DataFilesModals/DataFilesShowPa import { ToolbarButton } from '../DataFiles/DataFilesToolbar/DataFilesToolbar'; import styles from './PublicData.module.css'; +import dropdownStyles from '../../styles/components/dropdown-menu.css'; +import CombinedBreadcrumbs from '../DataFiles/CombinedBreadcrumbs/CombinedBreadcrumbs'; const PublicData = () => { const history = useHistory(); @@ -98,9 +100,9 @@ const PublicDataListing = ({ canDownload, downloadCallback }) => {
Date: Tue, 12 Dec 2023 14:40:58 -0600 Subject: [PATCH 5/5] WI-15: Add health check for site status (#919) * WI-15: Add health check for site status /core/health-check endpoint will provide ping status to validate nginx, uwsgi, django worker is up or not. * Remove used import * fix more lint errors --- server/portal/urls.py | 5 +++++ server/portal/views/unit_test.py | 7 +++++++ server/portal/views/views.py | 7 ++++++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/server/portal/urls.py b/server/portal/urls.py index 118071507..f19e91166 100644 --- a/server/portal/urls.py +++ b/server/portal/urls.py @@ -27,6 +27,7 @@ from django.views.generic.base import TemplateView from django.urls import path, re_path, include from impersonate import views as impersonate_views +from portal.views.views import health_check admin.autodiscover() urlpatterns = [ @@ -112,4 +113,8 @@ # version check. path('version/', portal_version), + # health check + path('core/health-check', health_check) + + ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) diff --git a/server/portal/views/unit_test.py b/server/portal/views/unit_test.py index cf3882ef8..f4ffbbf69 100644 --- a/server/portal/views/unit_test.py +++ b/server/portal/views/unit_test.py @@ -6,6 +6,7 @@ import requests import json + # route to be used for testing purposes API_ROUTE = '/api/system-monitor/' @@ -110,3 +111,9 @@ def test_exception(client, api_method_mock): response = client.get(API_ROUTE) assert response.status_code == 500 assert json.loads(response.content) == {'message': 'Something went wrong here...'} + + +def test_health_check(client): + response = client.get('/core/health-check') + assert response.status_code == 200 + assert json.loads(response.content) == {'status': 'healthy'} diff --git a/server/portal/views/views.py b/server/portal/views/views.py index cc4c2b90a..6c65764a2 100644 --- a/server/portal/views/views.py +++ b/server/portal/views/views.py @@ -1,5 +1,5 @@ import logging -from django.http import HttpResponse +from django.http import HttpResponse, JsonResponse logger = logging.getLogger(__name__) @@ -23,3 +23,8 @@ def project_version(request): version = 'UNKNOWN' return HttpResponse(version, content_type='text/plain') + + +def health_check(request): + health_status = {'status': 'healthy'} + return JsonResponse(health_status)