From 593a1e09ae5f731462db29d6f69dc5498b7d20b0 Mon Sep 17 00:00:00 2001 From: Ian Scott Date: Fri, 2 May 2025 15:11:39 -0400 Subject: [PATCH 1/6] fix(docs): Very minor docs updates --- docs/source/developing.md | 0 docs/source/developing/source_control.md | 10 +++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) delete mode 100644 docs/source/developing.md diff --git a/docs/source/developing.md b/docs/source/developing.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/source/developing/source_control.md b/docs/source/developing/source_control.md index f80306fb0..23a97623b 100644 --- a/docs/source/developing/source_control.md +++ b/docs/source/developing/source_control.md @@ -33,10 +33,18 @@ When a developer needs to make changes to the codebase, they should create a new Changes should be merged back into `main` as often as possible, and the temporary branches deleted. These merges should be performed when a developer is ready to deploy the changes to the staging server for testing. This should generally be done *after* the appropriate tests have been written and are passing. Merges should also represent a single completed change (feature or fix). Developers should, though, think in terms of small, incremental changes and merge often. -Merging to `main` should be done via pull request, and the merge only accepted if the newly added tests are present and passing. This ensures that the `main` branch is always in a deployable state and ready for incoming merges by other developers. Merges should be performed using the squash merge strategy (the equivalent of `git merge --squash `). This combines all of the incoming changes into a single commit, making the commit history cleaner and easier to read. +Merging to `main` should be done via pull request, and the merge only accepted if the newly added tests are present and passing. This ensures that the `main` branch is always in a deployable state and ready for incoming merges by other developers. + +```{note} +Merges into `main` should be performed using the `squash` merge strategy (the equivalent of `git merge --squash `). This combines all of the incoming changes into a single commit, making the commit history cleaner and easier to read. +``` No commits should be made directly to the `staging` or `production` branches. All changes should be made to the `main` branch and then merged into `staging` and `production` via pull requests. This is especially important because changes pushed to `staging` and `production` branches will automatically trigger rebuilding of the stanging or production containers and the deployment of the updated containers to the respective servers. +```{note} +Pull requests to staging and production should be merged using the `rebase` merge strategy, so that the commit history for these branches is kept clean and identical to the `main` branch. +``` + ### Commit strategy Developers should make frequent commits to their working branch. These may be as small and granular as the developer wishes since many incremental commits allow easy rollback to specific points in the development history. Such commits should be given descriptive names and commit messages that would allow quick identification of the changes. These commits will be squashed into a single commit when merged into `main`. From ae621e8e0a2bd566ed41bae6acdeb4238cb4432e Mon Sep 17 00:00:00 2001 From: Ian Scott Date: Fri, 2 May 2025 20:50:38 -0400 Subject: [PATCH 2/6] fix(theme): Minor collection page style fixes --- assets/less/site/collections/grid.overrides | 7 +++++++ .../assets/semantic-ui/js/collections/community/header.js | 2 +- .../invenio_communities/details/about/index.html | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/assets/less/site/collections/grid.overrides b/assets/less/site/collections/grid.overrides index a17509181..3fdc1b004 100644 --- a/assets/less/site/collections/grid.overrides +++ b/assets/less/site/collections/grid.overrides @@ -70,6 +70,13 @@ } } +.communities-detail-body.ui.grid { + .communities-detail-about.column, + .communities-detail-curation.column { + padding-top: 1.5rem; + } +} + .ui.form { #rdm-deposit-form { .ui.grid { diff --git a/site/kcworks/assets/semantic-ui/js/collections/community/header.js b/site/kcworks/assets/semantic-ui/js/collections/community/header.js index e87d5d2bf..516b79e40 100644 --- a/site/kcworks/assets/semantic-ui/js/collections/community/header.js +++ b/site/kcworks/assets/semantic-ui/js/collections/community/header.js @@ -160,7 +160,7 @@ const CommunityDetailsHeader = ({ {visibility == "restricted" && (
-
+
diff --git a/templates/semantic-ui/invenio_communities/details/about/index.html b/templates/semantic-ui/invenio_communities/details/about/index.html index 302ef1d70..aabc40127 100644 --- a/templates/semantic-ui/invenio_communities/details/about/index.html +++ b/templates/semantic-ui/invenio_communities/details/about/index.html @@ -26,7 +26,7 @@

{{ _("About") }}

-
+
{{ community.metadata.page | safe }}
From 12ff0bb9a375da8f60ee68c2a627e3ceff820b1a Mon Sep 17 00:00:00 2001 From: Ian Scott Date: Fri, 2 May 2025 21:37:07 -0400 Subject: [PATCH 3/6] fix(testing): Initial addition of GI tests to staging test run --- .github/workflows/tests.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e02fa9cb2..d2c0d46ca 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -107,3 +107,25 @@ jobs: run: | chmod +x run-js-tests.sh bash run-js-tests.sh + + ghost-inspector: + needs: test + runs-on: ubuntu-latest + if: (github.event_name == 'workflow_dispatch' || github.event_name == 'push' || github.event_name == 'pull_request') && (github.ref == 'refs/heads/staging' || github.head_ref == 'staging') + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Run Ghost Inspector Tests + uses: ghost-inspector/ghost-inspector-github-action@v1 + with: + apiKey: ${{ secrets.GHOST_INSPECTOR_API_KEY }} + # Base Works suite + suiteId: "66a3a33b333cf823ad8fff8a" + startUrl: "https://works.hcommons-staging.org" + # environment: ${{ vars.GHOST_INSPECTOR_ENVIRONMENT }} + variables: | + { + "base-url": "https://works.hcommons-staging.org" + } From 74fa00957b5dc736c15355fc81b1d0aaff147923 Mon Sep 17 00:00:00 2001 From: Ian Scott Date: Sat, 3 May 2025 19:48:17 -0400 Subject: [PATCH 4/6] fix(testing): Setting up automated Ghost Inspector test run for staging CI --- .github/workflows/tests.yml | 29 ++++++------------- .../works_collections_loggedIn_production.csv | 2 ++ .../works_collections_loggedIn_staging.csv | 2 ++ 3 files changed, 13 insertions(+), 20 deletions(-) create mode 100644 tests/e2e/works_collections_loggedIn_production.csv create mode 100644 tests/e2e/works_collections_loggedIn_staging.csv diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d2c0d46ca..9eaef9bc1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -108,24 +108,13 @@ jobs: chmod +x run-js-tests.sh bash run-js-tests.sh - ghost-inspector: - needs: test - runs-on: ubuntu-latest - if: (github.event_name == 'workflow_dispatch' || github.event_name == 'push' || github.event_name == 'pull_request') && (github.ref == 'refs/heads/staging' || github.head_ref == 'staging') - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Run Ghost Inspector Tests - uses: ghost-inspector/ghost-inspector-github-action@v1 + - name: execute Ghost Inspector test "collections logged in" + uses: docker://ghostinspector/cli with: - apiKey: ${{ secrets.GHOST_INSPECTOR_API_KEY }} - # Base Works suite - suiteId: "66a3a33b333cf823ad8fff8a" - startUrl: "https://works.hcommons-staging.org" - # environment: ${{ vars.GHOST_INSPECTOR_ENVIRONMENT }} - variables: | - { - "base-url": "https://works.hcommons-staging.org" - } + args: | + suite execute 66a3a33b333cf823ad8fff8a \ + --apiKey ${{ secrets.GHOST_INSPECTOR_API_KEY }} \ + --startUrl "https://works.hcommons-staging.org" \ + --dataSource "works_collections_loggedIn_staging.csv" \ + --errorOnFail \ + --errorOnScreenshotFail diff --git a/tests/e2e/works_collections_loggedIn_production.csv b/tests/e2e/works_collections_loggedIn_production.csv new file mode 100644 index 000000000..a86396d87 --- /dev/null +++ b/tests/e2e/works_collections_loggedIn_production.csv @@ -0,0 +1,2 @@ +base-url,collection-item-uuid +https://works.hcommons.org,95a6e518-9809-4be3-971e-fef2c98de42d \ No newline at end of file diff --git a/tests/e2e/works_collections_loggedIn_staging.csv b/tests/e2e/works_collections_loggedIn_staging.csv new file mode 100644 index 000000000..7a7de9a64 --- /dev/null +++ b/tests/e2e/works_collections_loggedIn_staging.csv @@ -0,0 +1,2 @@ +base-url,collection-item-uuid,member-result-email +https://works.hcommons-staging.org,95a6e518-9809-4be3-971e-fef2c98de42d,ghosthc@email.ghostinspector.com \ No newline at end of file From 0fc073f79c42ea766489611e4e817f282237eb4b Mon Sep 17 00:00:00 2001 From: Ian Scott Date: Sat, 3 May 2025 19:49:06 -0400 Subject: [PATCH 5/6] fix(requests): Re-exposing "cancel" button for requests even if the viewer isn't the request creator --- .../overridableRegistry/requests/actions/RequestActions.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/js/invenio_app_rdm/overridableRegistry/requests/actions/RequestActions.js b/assets/js/invenio_app_rdm/overridableRegistry/requests/actions/RequestActions.js index f05c4d9a2..97ad7e6ee 100644 --- a/assets/js/invenio_app_rdm/overridableRegistry/requests/actions/RequestActions.js +++ b/assets/js/invenio_app_rdm/overridableRegistry/requests/actions/RequestActions.js @@ -28,9 +28,9 @@ const RequestActions = ({ request, actions, size }) => { // FIXME: This is a temporary fix to hide the cancel action for // people other than the requester. This should be handled on the server side. - if ( !request.expanded.created_by.is_current_user ) { - actions = actions.filter(action => action !== "cancel"); - } + // if ( !request.expanded.created_by.is_current_user ) { + // actions = actions.filter(action => action !== "cancel"); + // } return ( From 4e9ee43d8de764027fed6511fe28cb4252845877 Mon Sep 17 00:00:00 2001 From: Ian Scott Date: Sat, 3 May 2025 21:36:25 -0400 Subject: [PATCH 6/6] fix(tests): Updating github action GI running --- .github/workflows/tests.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9eaef9bc1..d383652af 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -2,7 +2,7 @@ name: Tests on: push: - branches: [ main, dev ] + branches: [ main, dev, staging, production ] pull_request: branches: [ main, dev, staging, production ] schedule: @@ -108,13 +108,21 @@ jobs: chmod +x run-js-tests.sh bash run-js-tests.sh - - name: execute Ghost Inspector test "collections logged in" + - name: Create test data directory + run: mkdir -p test-data + + - name: Copy CSV file + run: cp tests/e2e/works_collections_loggedIn_staging.csv test-data/ + + - name: Execute Ghost Inspector tests + if: github.ref == 'refs/heads/staging' || github.ref == 'refs/heads/production' + env: + GHOST_INSPECTOR_API_KEY: ${{ secrets.GHOST_INSPECTOR_API_KEY }} uses: docker://ghostinspector/cli with: args: | - suite execute 66a3a33b333cf823ad8fff8a \ - --apiKey ${{ secrets.GHOST_INSPECTOR_API_KEY }} \ + suite execute 66a3a33b333cf823ad8fff8a 6815258158d7ce73a10ca70b \ --startUrl "https://works.hcommons-staging.org" \ - --dataSource "works_collections_loggedIn_staging.csv" \ + --dataFile "/github/workspace/test-data/works_collections_loggedIn_staging.csv" \ --errorOnFail \ --errorOnScreenshotFail