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

Srv 948 #31721

Closed
wants to merge 56 commits into from
Closed

Srv 948 #31721

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
a96a7fa
SRV-795 feat - reading language from url
nyohasstium Sep 18, 2024
8dd8101
SRV-762 feat - firing resizing event
nyohasstium Sep 19, 2024
60449ce
SRV-796 feat - adding build action
nyohasstium Sep 20, 2024
4f0137d
SRV-796 fix - adding empty line at end of file
nyohasstium Sep 20, 2024
1ab007a
SRV-796 fix - adding translations before build
nyohasstium Sep 20, 2024
fd65f6a
SRV-796 debug - mute webpack output
nyohasstium Sep 20, 2024
15b1030
SRV-796 fix - copying frontend folder before running build-translations
nyohasstium Sep 20, 2024
bdeb8a2
SRV-796 fix - linter issues
nyohasstium Sep 20, 2024
4a632a8
Fixed the `master` branch name
jeremypoulter Oct 16, 2024
afc6a9d
SRV-817: Detecting filters on subject with JSON (pie charts)
davidriverapericas Oct 24, 2024
51ca228
SRV-820: Better position of dropdown for results x page
davidriverapericas Oct 29, 2024
c2956c7
SRV-820: Adding titles to comparison tables
davidriverapericas Oct 29, 2024
d39a1a0
SRV-820 chore - changing main to current value
nyohasstium Oct 30, 2024
1a3f8a8
SRV-820 chore - removing special triangle character
nyohasstium Oct 30, 2024
3731487
SRV-820 chore - removing # and renaming main
nyohasstium Oct 30, 2024
fe7375e
SRV-818 feat - adding setup for webgains lokalise keys
nyohasstium Oct 28, 2024
c3b3150
SRV-818 feat - adding superset user to folder copy
nyohasstium Oct 28, 2024
e4260ea
SRV-818 fix - correcting bash comment
nyohasstium Oct 28, 2024
7134543
SRS-818 fix - nuking permissions on scripts
nyohasstium Oct 28, 2024
a20d0c7
SRV-818 fix - correcting script path
nyohasstium Oct 28, 2024
ba23d49
SRV-818 fix - adding execute permission
nyohasstium Oct 28, 2024
e5a9ffc
SRV-818 fix - removing overkill permission grants
nyohasstium Oct 28, 2024
c1ea28e
SRV-818 feat - uploading initial lokalise dump
nyohasstium Nov 5, 2024
52a0f53
LOC-176
bob-t-builder Nov 13, 2024
ff15eac
LOC-176 V2
bob-t-builder Nov 14, 2024
63561ce
SRV-862: dispatch click to parent
GregLebret Nov 15, 2024
6c6cfbd
SRV-862: fix code formatting
GregLebret Nov 18, 2024
a131b95
SRV-862: addEventListener on document
GregLebret Nov 18, 2024
9644ae0
SRV-862: revert document listener
GregLebret Nov 18, 2024
d49f5ea
SRV-862: add document listener
GregLebret Nov 18, 2024
2104d75
SRV-894 revert - reverting translations
nyohasstium Nov 21, 2024
67d1466
SRV-894 revert - reverting translations
nyohasstium Nov 21, 2024
79502cc
SRV-894 fix - removing "Main" from keys
bob-t-builder Nov 22, 2024
8fd959e
Update translation.json
nyohasstium Nov 22, 2024
9a0e8c1
Update translation.json
nyohasstium Nov 22, 2024
6dd2823
Update translation.json
nyohasstium Nov 22, 2024
5ccac94
Update translation.json
nyohasstium Nov 22, 2024
a743956
Update translation.json
nyohasstium Nov 22, 2024
db54e9e
Update translation.json
nyohasstium Nov 22, 2024
af9fdd8
Update translation.json
nyohasstium Nov 22, 2024
efc4183
pre-commit fixes
jeremypoulter Dec 12, 2024
9f6c5cf
Fix for lint issue
jeremypoulter Dec 12, 2024
caffede
Disable workflows that are not relavent to us (yet)
jeremypoulter Dec 12, 2024
969b413
Removed whitespace
jeremypoulter Dec 12, 2024
d82daa4
pre-commit reformatting
jeremypoulter Dec 12, 2024
d2ec6c5
Disable E2E tests and Frontend tests from running as they fail on our…
jeremypoulter Dec 12, 2024
07069f5
Lint fixes
jeremypoulter Dec 13, 2024
6a8276e
WI-5739 - Updates to deploy the built Docker to the feature env
jeremypoulter Dec 17, 2024
e3c513e
WI-5739 - Added missing dependancy
jeremypoulter Dec 18, 2024
fbd22a0
SRV-932 security - not returning query in request if user has no perm…
nyohasstium Dec 17, 2024
096b4d5
SRV-932 fix - removing query from explicit view query request
nyohasstium Dec 18, 2024
71dfe1a
SRV-872
bob-t-builder Dec 5, 2024
029cf78
SRV-872 feat - adding better translations for comparison table
nyohasstium Dec 18, 2024
166aabb
SRV-872 fix - removing input overwrite
nyohasstium Dec 18, 2024
75062f9
SRV-920 feat - calculating correct date for 'X ... ago' tooltips
nyohasstium Dec 19, 2024
cab623f
SRV-872 fix - missing comma
nyohasstium Dec 20, 2024
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
66 changes: 66 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: "Docker Images"

on:
push:
branches:
- master
workflow_call:
outputs:
tag_hash:
description: "The commit hash used to tag the Docker image"
value: ${{ jobs.build-image.outputs.tag_hash }}

env:
AWS_REGION: eu-west-1

jobs:
build-image:
name: Build, Tag and Upload
runs-on: ubuntu-latest
env:
SUPERSET_REPOSITORY_URI: "289222877357.dkr.ecr.eu-west-1.amazonaws.com/webgains/superset"

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Create dist directory
run: mkdir dist

- name: Compute labels
id: compute_labels
run: |
TAG_HASH="$(echo $GITHUB_SHA | head -c 8)"
TAG_NAME="$(echo $GITHUB_REF | sed -E -e 's:refs/pull/([0-9]+)/merge:pr.\1:' -e 's:refs/heads/::' -e 's:tag/v?([.0-9]+):v\1:' -e 's:/:.:')"
echo "TAG_HASH=$TAG_HASH" >> $GITHUB_ENV
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV
if [ $TAG_NAME = "main" ]; then echo "LATEST_TAG=$SUPERSET_REPOSITORY_URI:latest" >> $GITHUB_ENV; fi
echo "tag_hash=$TAG_HASH" >> $GITHUB_OUTPUT

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4.0.2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2.0.1

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
tags: |
${{ env.SUPERSET_REPOSITORY_URI }}:${{ env.TAG_HASH }}
${{ env.SUPERSET_REPOSITORY_URI }}:${{ env.TAG_NAME }}
${{ env.LATEST_TAG }}
outputs:
tag_hash: ${{ steps.compute_labels.outputs.tag_hash }}
5 changes: 3 additions & 2 deletions .github/workflows/license-check.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: License Template Check

on:
pull_request:
types: [synchronize, opened, reopened, ready_for_review]
workflow_dispatch:
# pull_request:
# types: [synchronize, opened, reopened, ready_for_review]

# cancel previous workflow jobs for PRs
concurrency:
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/pr-closed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: PR Cleanup

on:
pull_request:
types: [closed]

jobs:
destroy:
name: Destroy Stack
uses: webgains/github-workflows/.github/workflows/destroy-stack.yml@main
secrets: inherit
with:
environment: feature
stack: superset-pr-${{ github.event.pull_request.number }}SupersetService
permissions:
contents: read
deployments: write
id-token: write
50 changes: 50 additions & 0 deletions .github/workflows/pr-deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: PR Deployment

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
build:
uses: ./.github/workflows/build.yml
name: Build
secrets: inherit
permissions:
checks: write
actions: write
contents: write
packages: read
issues: read
pull-requests: write

labels:
runs-on: ubuntu-latest
name: Add Labels
steps:
- name: Add labels
id: add_labels
run: |
echo "feature_name=superset-pr-${{ github.event.pull_request.number }}" | sed 's:\.:-:g' >> $GITHUB_OUTPUT
outputs:
feature_name: ${{ steps.add_labels.outputs.feature_name }}

deploy:
name: Deploy to Feature Environment
needs: [labels, build]
uses: webgains/github-workflows/.github/workflows/deploy-service-to-environment.yml@WI-5868-allow-service-deploy-workflow-to-use-any-repositor
secrets: inherit
with:
environment: feature
name: ${{ needs.labels.outputs.feature_name }}
stack: ${{ needs.labels.outputs.feature_name }}
service: superset
component: service
override: |
{
"namespace": "${{ needs.labels.outputs.feature_name }}",
"supersetImageTag": "${{ needs.build.outputs.tag_hash }}"
}
permissions:
contents: read
deployments: write
id-token: write
5 changes: 3 additions & 2 deletions .github/workflows/pr-lint.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
name: PR Lint

on:
pull_request:
workflow_dispatch:
# pull_request:
# By default, a workflow only runs when a pull_request's activity type is opened, synchronize, or reopened. We
# explicity override here so that PR titles are re-linted when the PR text content is edited.
#
# Possible values: https://help.github.com/en/actions/reference/events-that-trigger-workflows#pull-request-event-pull_request
types: [opened, edited, reopened, synchronize]
# types: [opened, edited, reopened, synchronize]

jobs:
lint-check:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/superset-e2e.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: E2E

on:
push:
branches:
- "master"
- "[0-9].[0-9]*"
pull_request:
types: [synchronize, opened, reopened, ready_for_review]
# push:
# branches:
# - "master"
# - "[0-9].[0-9]*"
# pull_request:
# types: [synchronize, opened, reopened, ready_for_review]
workflow_dispatch:
inputs:
use_dashboard:
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/superset-frontend.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
name: Frontend

on:
push:
branches:
- "master"
- "[0-9].[0-9]*"
pull_request:
types: [synchronize, opened, reopened, ready_for_review]
workflow_dispatch:
# push:
# branches:
# - "master"
# - "[0-9].[0-9]*"
# pull_request:
# types: [synchronize, opened, reopened, ready_for_review]

# cancel previous workflow jobs for PRs
concurrency:
Expand Down
36 changes: 17 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ARG BUILDPLATFORM=${BUILDPLATFORM:-amd64}
# superset-node used for building frontend assets
######################################################################
FROM --platform=${BUILDPLATFORM} node:20-bullseye-slim AS superset-node
ARG BUILD_TRANSLATIONS="false" # Include translations in the final build
ARG BUILD_TRANSLATIONS="true"
ENV BUILD_TRANSLATIONS=${BUILD_TRANSLATIONS}
ARG DEV_MODE="false" # Skip frontend build in dev mode
ENV DEV_MODE=${DEV_MODE}
Expand All @@ -37,7 +37,7 @@ COPY docker/ /app/docker/
ARG NPM_BUILD_CMD="build"

# Install system dependencies required for node-gyp
RUN /app/docker/apt-install.sh build-essential python3 zstd
RUN /app/docker/apt-install.sh build-essential python3 zstd jq

# Define environment variables for frontend build
ENV BUILD_CMD=${NPM_BUILD_CMD} \
Expand Down Expand Up @@ -66,26 +66,19 @@ RUN --mount=type=bind,source=./superset-frontend/package.json,target=./package.j
# Runs the webpack build process
COPY superset-frontend /app/superset-frontend

# Build the frontend if not in dev mode
RUN --mount=type=cache,target=/app/superset-frontend/.temp_cache \
--mount=type=cache,target=/root/.npm \
if [ "$DEV_MODE" = "false" ]; then \
echo "Running 'npm run ${BUILD_CMD}'"; \
npm run ${BUILD_CMD}; \
else \
echo "Skipping 'npm run ${BUILD_CMD}' in dev mode"; \
fi;

# Copy translation files
# This copies the .po files needed for translation
RUN mkdir -p /app/superset/translations
COPY superset/translations /app/superset/translations

# Build the frontend if not in dev mode
RUN if [ "$BUILD_TRANSLATIONS" = "true" ]; then \
npm run build-translation; \
fi; \
rm -rf /app/superset/translations/*/*/*.po; \
rm -rf /app/superset/translations/*/*/*.mo;
RUN mkdir -p /app/locales
COPY locales /app/locales

# Compiles .json files from the .po files, then deletes the .po files
RUN npm run build-translation
RUN rm /app/superset/translations/*/LC_MESSAGES/*.po
RUN rm /app/superset/translations/messages.pot

RUN npm run ${BUILD_CMD}

######################################################################
# Base python layer
Expand All @@ -96,6 +89,11 @@ ENV BUILD_TRANSLATIONS=${BUILD_TRANSLATIONS}
ARG DEV_MODE="false" # Skip frontend build in dev mode
ENV DEV_MODE=${DEV_MODE}

# Include translations in the final build. The default supports en only to
# reduce complexity and weight for those only using en
ARG BUILD_TRANSLATIONS="true"

WORKDIR /app
ENV LANG=C.UTF-8 \
LC_ALL=C.UTF-8 \
SUPERSET_ENV=production \
Expand Down
Empty file added locales/.gitkeep
Empty file.
Loading