Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
709ce48
fix: remove oldest report only if report count is more than 10
kneerose May 14, 2025
9649e97
feat: add test schedule for nightly workflows and update base urls
kneerose May 14, 2025
c92d5db
chore: skip proposal submission test for schedule workflow
kneerose May 14, 2025
e47a62d
feat: add schedule workflow variable on integration-test workflow
kneerose May 14, 2025
f3c14c1
feat: prepend 'nightly-' to report names for scheduled workflows
kneerose May 14, 2025
cc36114
ix: update sorting method to use version sort for oldest report direc…
kneerose May 14, 2025
860d9f0
fix: allow scheduled runs for backend and integration tests
kneerose May 14, 2025
48c6f1a
fix: add newline before report name in register_report script
kneerose May 14, 2025
5781bb4
chore: set proposal wallet stake pkh to faucet stake pkh
kneerose May 16, 2025
e5d7ce5
fix: rename environment variable for scheduled workflow
kneerose May 16, 2025
7adbc19
Merge pull request #3628 from IntersectMBO/feat/nightly-preview-test-run
kneerose May 16, 2025
1086814
chore: add public and private stake keys to faucet configuration
kneerose May 19, 2025
c383a73
chore: update README and wallet generation script to include stake pr…
kneerose May 19, 2025
c077613
chore: add stake keys to wallet and handle username input during prop…
kneerose May 19, 2025
aaacacb
chore: remove stake public key and public key hash from env
kneerose May 20, 2025
a3b7c6a
feat: generate keys from private keyHex
kneerose May 20, 2025
3d4e9ee
chore: remove stake public key and public key hash from environments …
kneerose May 20, 2025
cae4f38
Merge pull request #3641 from IntersectMBO/standardize-proposal-stake…
kneerose May 20, 2025
6a72cdf
feat(#3647): add fixed top banner for govtool maintenance notice
MSzalowski May 20, 2025
8aacc01
Merge pull request #3650 from IntersectMBO/feat/3647-add-fixed-top-ba…
MSzalowski May 20, 2025
8032532
Merge pull request #3651 from IntersectMBO/develop
MSzalowski May 20, 2025
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 .github/scripts/register_report.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ if grep -q "$REPORT_NAME" "$PROJECT_DIR/$PROJECT_FILE"; then
echo "Project already exists"
echo "project_exists=true">> $GITHUB_OUTPUT
else
echo "$REPORT_NAME" >> "$PROJECT_DIR/$PROJECT_FILE"
echo "\n$REPORT_NAME" >> "$PROJECT_DIR/$PROJECT_FILE"
echo "project_exists=false">> $GITHUB_OUTPUT
fi
19 changes: 13 additions & 6 deletions .github/scripts/remove_oldest_report.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,21 @@

if [ -d "gh-pages/$REPORT_NAME" ]; then
cd gh-pages/$REPORT_NAME
# Find the oldest numerical directory
oldest_dir=$(find . -maxdepth 1 -type d -regex './[0-9]+' | sort -n | head -1)
if [ -n "$oldest_dir" ]; then
echo "Removing oldest report directory: $oldest_dir"
rm -rf "$oldest_dir"

# Count the number of numerical directories
dir_count=$(find . -maxdepth 1 -type d -regex './[0-9]+' | wc -l)

if [ "$dir_count" -gt 10 ]; then
# Find the oldest numerical directory
oldest_dir=$(find . -maxdepth 1 -type d -regex './[0-9]+' | sort -V | head -1)
if [ -n "$oldest_dir" ]; then
echo "More than 10 report directories exist. Removing oldest: $oldest_dir"
rm -rf "$oldest_dir"
fi
else
echo "No report directories found to remove"
echo "Only $dir_count report directories exist (threshold: 10). Nothing to remove."
fi

cd ../../
else
echo "Report directory does not exist yet"
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/test_backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ on:
- "sanchogov.tools/api"
- "staging.govtool.byron.network/api"
- "govtool.cardanoapi.io/api"
- "be.preview.gov.tools"
- "z6b8d2f7a-zca4a4c45-gtw.z937eb260.rustrocks.fr"
- "z78acf3c2-z5575152b-gtw.z937eb260.rustrocks.fr"
- "be.gov.tools"
Expand All @@ -28,21 +29,25 @@ on:
- "preview"
- "mainnet"
- "preprod"

workflow_run:
workflows: ["Build and deploy GovTool test stack"]
types: [completed]
branches:
- test
- infra/test-chores

schedule:
- cron: "0 0 * * *" # 12AM UTC

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false

jobs:
backend-tests:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' || github.event.schedule }}
outputs:
start_time: ${{ steps.set-pending-status.outputs.timestamp }}
status: ${{ steps.run-tests.outcome }}
Expand Down Expand Up @@ -115,7 +120,7 @@ jobs:
path: gh-pages
repository: ${{vars.GH_PAGES}}
ssh-key: ${{ secrets.DEPLOY_KEY }}

- name: Remove oldest report to save space
if: ${{success()}}
run: |
Expand All @@ -128,6 +133,7 @@ jobs:
run: |
chmod +x .github/scripts/register_report.sh
.github/scripts/register_report.sh

- if: steps.register-project.outputs.project_exists != 'true'
uses: JamesIves/github-pages-deploy-action@v4
with:
Expand Down Expand Up @@ -191,7 +197,7 @@ jobs:
GITHUB_TOKEN: ${{ github.token }}

env:
BASE_URL: https://${{inputs.deployment || 'govtool.cardanoapi.io/api' }}
REPORT_NAME: govtool-backend
BASE_URL: https://${{github.event.schedule && 'be.preview.gov.tools' || inputs.deployment || 'govtool.cardanoapi.io/api' }}
REPORT_NAME: ${{ github.event.schedule && 'nightly-'}}govtool-backend
GH_PAGES: ${{vars.GH_PAGES}}
COMMIT_SHA: ${{ github.event.workflow_run.head_sha || github.sha }}
16 changes: 12 additions & 4 deletions .github/workflows/test_integration_playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,17 @@ on:
- test
- infra/test-chores

schedule:
- cron: "0 0 * * *" # 12AM UTC

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false

jobs:
integration-tests:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' || github.event.schedule }}
outputs:
start_time: ${{ steps.set-pending-status.outputs.timestamp }}
status: ${{ steps.run-test.outcome }}
Expand Down Expand Up @@ -103,6 +106,11 @@ jobs:
export BLOCKFROST_API_KEY="${{ secrets.BLOCKFROST_API_KEY_MAINNET }}"
fi

# Set schedule workflow variable
if [[ "$GITHUB_EVENT_NAME" == "schedule" ]]; then
export SCHEDULED_WORKFLOW="true"
fi

npm run test:headless

- name: Upload report
Expand Down Expand Up @@ -165,7 +173,7 @@ jobs:
run: |
chmod +x .github/scripts/register_report.sh
.github/scripts/register_report.sh

- if: steps.register-project.outputs.project_exists != 'true'
uses: JamesIves/github-pages-deploy-action@v4
with:
Expand Down Expand Up @@ -229,7 +237,7 @@ jobs:
REPORT_NUMBER: ${{ needs.publish-report.outputs.report_number }}
GITHUB_TOKEN: ${{ github.token }}
env:
HOST_URL: https://${{inputs.deployment || 'govtool.cardanoapi.io' }}
REPORT_NAME: govtool-frontend
HOST_URL: https://${{ github.event.schedule && 'preview.gov.tools' || (inputs.deployment || 'govtool.cardanoapi.io') }}
REPORT_NAME: ${{ github.event.schedule && 'nightly-'}}govtool-frontend
GH_PAGES: ${{vars.GH_PAGES}}
COMMIT_SHA: ${{ github.event.workflow_run.head_sha || github.sha }}
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ changes.

### Added

- Add maintenance ending banner [Issue 3647](https://github.com/IntersectMBO/govtool/issues/3647)

### Fixed

### Changed
Expand All @@ -20,7 +22,6 @@ changes.

## [v2.0.22](https://github.com/IntersectMBO/govtool/releases/tag/v2.0.22) 2025-05-15


### Added

### Fixed
Expand Down
106 changes: 106 additions & 0 deletions govtool/frontend/src/components/organisms/MaintenanceEndingBanner.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
import { Box, Typography, IconButton } from "@mui/material";
import { useState } from "react";
import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown";
import KeyboardArrowUpIcon from "@mui/icons-material/KeyboardArrowUp";
import { Trans, useTranslation } from "react-i18next";

export const MaintenanceEndingBanner = () => {
const [isExpanded, setIsExpanded] = useState(true);
const { t } = useTranslation();

const handleToggle = () => {
setIsExpanded((prev) => !prev);
};

return (
<Box
sx={{
backgroundColor: "#9c2224",
width: "100%",
overflow: "hidden",
transition: "all 0.3s ease-in-out",
}}
>
{/* Banner Header */}
<Box
sx={{
px: 2,
py: 1,
textAlign: "left",
display: "flex",
justifyContent: "space-between",
alignItems: "center",
}}
>
<Box sx={{ display: "flex", alignItems: "center" }}>
<Typography
variant="body2"
fontWeight={600}
color="common.white"
sx={{ display: "flex", alignItems: "center" }}
>
{t("system.maintenanceEnding.title")}
</Typography>
</Box>
<Box sx={{ display: "flex" }}>
<IconButton
onClick={handleToggle}
size="small"
data-testid="toggle-maintenance-banner"
sx={{
color: "white",
transition: "transform 0.3s ease",
}}
>
{isExpanded ? <KeyboardArrowUpIcon /> : <KeyboardArrowDownIcon />}
</IconButton>
</Box>
</Box>

{/* Expandable Content */}
<Box
sx={{
maxHeight: isExpanded ? "500px" : "0px",
transition: "max-height 0.3s ease-in-out",
overflow: "hidden",
}}
>
<Box
sx={{
px: 2,
pb: 2,
color: "white",
display: "flex",
flexDirection: "column",
}}
>
<Typography
fontWeight={600}
variant="caption"
color="common.white"
mb={0.5}
>
{t("system.maintenanceEnding.description1")}
</Typography>
<Typography variant="caption" color="common.white" mb={0.5}>
<Trans
i18nKey="system.maintenanceEnding.description2"
components={[
<Typography
key="1"
variant="caption"
fontWeight={600}
color="common.white"
component="span"
/>,
]}
/>
</Typography>
<Typography variant="caption" color="common.white">
{t("system.maintenanceEnding.description3")}
</Typography>
</Box>
</Box>
</Box>
);
};
Loading