From bb97df373e151e20211a1149149d9d8bea5a9e3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Barrag=C3=A1n=20Merino?= Date: Fri, 4 Jul 2025 08:25:23 +0200 Subject: [PATCH 1/4] :wrench: Add Github Action to build and upload artifact (#6840) Co-authored-by: Francis Santiago --- .github/workflows/build-bundles.yml | 128 ++++++++++++++++++++++++++++ docker/devenv/Dockerfile | 2 +- manage.sh | 6 +- 3 files changed, 134 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/build-bundles.yml diff --git a/.github/workflows/build-bundles.yml b/.github/workflows/build-bundles.yml new file mode 100644 index 0000000000..80b31851ff --- /dev/null +++ b/.github/workflows/build-bundles.yml @@ -0,0 +1,128 @@ +name: Build and Upload Penpot Bundles non-prod + +on: + # Create bundler for every tag + push: + tags: + - '**' # Pattern matched against refs/tags + # Create bundler every hour between 5:00 and 20:00 on working days + schedule: + - cron: '0 5-20 * * 1-5' + # Create bundler from manual action + workflow_dispatch: + inputs: + zip_mode: + # zip_mode defines how the build artifacts are packaged: + # - 'individual': creates one ZIP file per component (frontend, backend, exporter) + # - 'all': creates a single ZIP containing all components + description: 'Bundle packaging mode' + required: false + default: 'individual' + type: choice + options: + - individual + - all + +jobs: + build-bundles: + name: Build and Upload Penpot Bundles + runs-on: ubuntu-24.04 + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION }} + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Extract somer useful variables + id: vars + run: | + echo "commit_hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + echo "gh_branch=${{ github.base_ref || github.ref_name }}" >> $GITHUB_OUTPUT + + # Set up Docker Buildx for multi-arch build + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Run manage.sh build-bundle from host + run: ./manage.sh build-bundle + + - name: Prepare directories for zipping + run: | + mkdir zips + mv bundles penpot + + - name: Create zip bundles for zip_mode == 'all' + if: ${{ github.event.inputs.zip_mode == 'all' }} + run: | + echo "📦 Packaging Penpot 'all' bundles..." + zip -r zips/penpot-all-bundles.zip penpot + + - name: Create zip bundles for zip_mode == 'individual' + if: ${{ github.event.inputs.zip_mode == 'individual' }} + run: | + echo "📦 Packaging Penpot 'individual' bundles..." + zip -r zips/penpot-frontend.zip penpot/frontend + zip -r zips/penpot-backend.zip penpot/backend + zip -r zips/penpot-exporter.zip penpot/exporter + + - name: Upload unified 'all' bundle + if: ${{ github.event.inputs.zip_mode == 'all' }} + uses: actions/upload-artifact@v4 + with: + name: penpot-all-bundles + path: zips/penpot-all-bundles.zip + + - name: Upload individual bundles + if: ${{ github.event.inputs.zip_mode == 'individual' }} + uses: actions/upload-artifact@v4 + with: + name: penpot-individual-bundles + path: | + zips/penpot-frontend.zip + zips/penpot-backend.zip + zips/penpot-exporter.zip + + - name: Upload unified 'all' bundle to S3 + if: ${{ github.event.inputs.zip_mode == 'all' }} + run: | + aws s3 cp zips/penpot-all-bundles.zip s3://${{ secrets.S3_BUCKET }}/penpot-all-bundles-${{ steps.vars.outputs.gh_branch}}.zip + aws s3 cp zips/penpot-all-bundles.zip s3://${{ secrets.S3_BUCKET }}/penpot-all-bundles-${{ steps.vars.outputs.commit_hash }}.zip + + - name: Upload 'individual' bundles to S3 + if: ${{ github.event.inputs.zip_mode == 'individual' }} + run: | + for name in penpot-frontend penpot-backend penpot-exporter; do + aws s3 cp zips/${name}.zip s3://${{ secrets.S3_BUCKET }}/${name}-${{ steps.vars.outputs.gh_branch }}-latest.zip + aws s3 cp zips/${name}.zip s3://${{ secrets.S3_BUCKET }}/${name}-${{ steps.vars.outputs.commit_hash }}.zip + done + + - name: Notify Mattermost about automatic bundles + if: github.event_name == 'pull_request' + uses: mattermost/action-mattermost-notify@master + with: + MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK }} + TEXT: | + 📦 *Penpot bundle automatically generated* + 📄 PR: ${{ github.event.pull_request.title }} + 🔁 From: \`${{ github.head_ref }}\` to \`{{ github.base_ref }}\` + 🔗 Run: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} + + - name: Notify Mattermost about manual bundles + if: github.event_name == 'workflow_dispatch' + uses: mattermost/action-mattermost-notify@master + with: + MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK }} + TEXT: | + 📦 *Penpot bundle manually generated* + 📄 Triggered from branch: `${{ github.ref_name}}` + 🔗 Run: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} + + - name: Print artifact summary URL + run: | + echo "📦 Artifacts available at:" + echo "🔗 https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" diff --git a/docker/devenv/Dockerfile b/docker/devenv/Dockerfile index b46ab7ce77..a7c5ff8265 100644 --- a/docker/devenv/Dockerfile +++ b/docker/devenv/Dockerfile @@ -404,4 +404,4 @@ COPY files/entrypoint.sh /home/entrypoint.sh COPY files/init.sh /home/init.sh ENTRYPOINT ["/home/entrypoint.sh"] -CMD ["/home/init.sh"] +CMD ["/home/init.sh"] \ No newline at end of file diff --git a/manage.sh b/manage.sh index 4e8e8374d8..491f1f1431 100755 --- a/manage.sh +++ b/manage.sh @@ -7,6 +7,10 @@ export DEVENV_PNAME="penpotdev"; export CURRENT_USER_ID=$(id -u); export CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD); + +# Safe directory to avoid ownership errors with Git +git config --global --add safe.directory /home/penpot/penpot || true + # Set default java options export JAVA_OPTS=${JAVA_OPTS:-"-Xmx1000m -Xms50m"}; @@ -356,4 +360,4 @@ case $1 in *) usage ;; -esac +esac \ No newline at end of file From 6d41d36b3a7a89df5b289340da661f0dc88c8de0 Mon Sep 17 00:00:00 2001 From: Alonso Torres Date: Fri, 4 Jul 2025 09:01:20 +0200 Subject: [PATCH 2/4] :bug: Fix problem when double click on hidden shapes (#6833) --- CHANGES.md | 1 + frontend/src/app/main/ui/workspace/viewport/hooks.cljs | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index aedaad7ed2..8b300a48dc 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -39,6 +39,7 @@ on-premises instances** that want to keep up to date. - Update google fonts (at 2025/05/19) [Taiga 10792](https://tree.taiga.io/project/penpot/us/10792) - Add tooltip component to DS [Taiga 9220](https://tree.taiga.io/project/penpot/us/9220) - Allow multi file token export [Taiga #10144](https://tree.taiga.io/project/penpot/us/10144) +- Fix problem when double click on hidden shapes [Taiga #11314](https://tree.taiga.io/project/penpot/issue/11314) ### :bug: Bugs fixed diff --git a/frontend/src/app/main/ui/workspace/viewport/hooks.cljs b/frontend/src/app/main/ui/workspace/viewport/hooks.cljs index 23ab6e11da..0551cde8fe 100644 --- a/frontend/src/app/main/ui/workspace/viewport/hooks.cljs +++ b/frontend/src/app/main/ui/workspace/viewport/hooks.cljs @@ -286,7 +286,8 @@ (fn [mod? ids] (let [sorted-ids (into (d/ordered-set) - (comp (remove #(dm/get-in objects [% :blocked])) + (comp (remove (partial cfh/hidden-parent? objects)) + (remove #(dm/get-in objects [% :blocked])) (remove (partial cfh/svg-raw-shape? objects))) (ctt/sort-z-index objects ids {:bottom-frames? mod?}))] (mf/set-ref-val! sorted-ids-cache (assoc cached-ids [mod? ids] sorted-ids)) @@ -355,7 +356,6 @@ hover-shape (->> ids (remove remove-hover?) - (remove (partial cfh/hidden-parent? objects)) (remove #(and mod? (no-fill-nested-frames? %))) (filter #(or (empty? focus) (cpf/is-in-focus? objects focus %))) (first) @@ -366,7 +366,6 @@ (when show-measures? (->> ids (remove remove-measure?) - (remove (partial cfh/hidden-parent? objects)) (remove #(and mod? (no-fill-nested-frames? %))) (filter #(or (empty? focus) (cpf/is-in-focus? objects focus %))) (first) From 78d0e6d0598402a9384aff2b21a34a9a23c57240 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Fri, 4 Jul 2025 10:04:16 +0200 Subject: [PATCH 3/4] :sparkles: Add minor improvements to error report on calc bool content --- common/src/app/common/types/path.cljc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/common/src/app/common/types/path.cljc b/common/src/app/common/types/path.cljc index bcfa323c82..017a8df15d 100644 --- a/common/src/app/common/types/path.cljc +++ b/common/src/app/common/types/path.cljc @@ -200,7 +200,17 @@ contents (sequence extract-content-xf (:shapes shape))] - (bool/calculate-content (:bool-type shape) contents))) + (ex/try! + (bool/calculate-content (:bool-type shape) contents) + + :on-exception + (fn [cause] + (ex/raise :type :internal + :code :invalid-path-content + :hint (str "unable to calculate bool content for shape " (:id shape)) + :shapes (:shapes shape) + :content (mapv str contents) + :cause cause))))) (defn calc-bool-content "Calculate the boolean content from shape and objects. Returns a From 6d21fcc9de940ade6c030379bf430429e8f9e116 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Barrag=C3=A1n=20Merino?= Date: Fri, 4 Jul 2025 11:57:57 +0200 Subject: [PATCH 4/4] :wrench: Fix condition for automatic events (#6849) --- .github/workflows/build-bundles.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-bundles.yml b/.github/workflows/build-bundles.yml index 80b31851ff..ff2f37f75f 100644 --- a/.github/workflows/build-bundles.yml +++ b/.github/workflows/build-bundles.yml @@ -15,6 +15,7 @@ on: # zip_mode defines how the build artifacts are packaged: # - 'individual': creates one ZIP file per component (frontend, backend, exporter) # - 'all': creates a single ZIP containing all components + # - null: for the rest of cases (non-manual events) description: 'Bundle packaging mode' required: false default: 'individual' @@ -62,8 +63,8 @@ jobs: echo "📦 Packaging Penpot 'all' bundles..." zip -r zips/penpot-all-bundles.zip penpot - - name: Create zip bundles for zip_mode == 'individual' - if: ${{ github.event.inputs.zip_mode == 'individual' }} + - name: Create zip bundles for zip_mode != 'all' + if: ${{ github.event.inputs.zip_mode != 'all' }} run: | echo "📦 Packaging Penpot 'individual' bundles..." zip -r zips/penpot-frontend.zip penpot/frontend @@ -78,7 +79,7 @@ jobs: path: zips/penpot-all-bundles.zip - name: Upload individual bundles - if: ${{ github.event.inputs.zip_mode == 'individual' }} + if: ${{ github.event.inputs.zip_mode != 'all' }} uses: actions/upload-artifact@v4 with: name: penpot-individual-bundles @@ -94,7 +95,7 @@ jobs: aws s3 cp zips/penpot-all-bundles.zip s3://${{ secrets.S3_BUCKET }}/penpot-all-bundles-${{ steps.vars.outputs.commit_hash }}.zip - name: Upload 'individual' bundles to S3 - if: ${{ github.event.inputs.zip_mode == 'individual' }} + if: ${{ github.event.inputs.zip_mode != 'all' }} run: | for name in penpot-frontend penpot-backend penpot-exporter; do aws s3 cp zips/${name}.zip s3://${{ secrets.S3_BUCKET }}/${name}-${{ steps.vars.outputs.gh_branch }}-latest.zip