From 511876bc630be84045bca7320dc585cea7f0ded7 Mon Sep 17 00:00:00 2001 From: addshore Date: Fri, 4 Dec 2020 16:47:17 +0000 Subject: [PATCH 01/37] WBSTACK MODIFICATIONS Some modifications and rebased on changes from upstream 2025-07-02 --- .dockerignore | 4 +++ Dockerfile | 18 ++++++++++ docker-compose.yaml | 10 ++++++ docker/default.conf | 35 ++++++++++++++++++++ style.less | 32 ++++++++++++++++++ wikibase/config.js | 58 ++++++++++++++++++++++++++++++++- wikibase/init.js | 7 +++- wikibase/queryService/ui/App.js | 4 ++- 8 files changed, 165 insertions(+), 3 deletions(-) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 docker-compose.yaml create mode 100644 docker/default.conf diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..471d35d8 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +# We only want to ignore these for the docker build +# I hope they are included in docker-compose... +/src/node_modules +/src/build diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..042f134b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM node:12 AS builder + +WORKDIR /src/app + +COPY package.json package-lock.json ./ + +# TODO remove the --force from the install... +RUN npm install --force && npm cache clean --force + +COPY . . + +RUN npm run-script build + + +FROM nginx:1-alpine + +ADD ./nginx/default.conf /etc/nginx/conf.d/default.conf +COPY --from=builder --chown=nginx:nginx /src/app/build /usr/share/nginx/html diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 00000000..c50cdb17 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,10 @@ +version: "3.7" +services: + debug: + image: node:12-alpine + working_dir: /home/node/app + command: npm start + volumes: + - ./src:/home/node/app + expose: + - "8080" diff --git a/docker/default.conf b/docker/default.conf new file mode 100644 index 00000000..15a58229 --- /dev/null +++ b/docker/default.conf @@ -0,0 +1,35 @@ +server { + listen 80 default_server; + listen [::]:80 default_server; + server_name localhost; + charset utf-8; + + # files transfer + client_body_in_file_only clean; + client_body_buffer_size 32K; + client_max_body_size 1026g; + sendfile on; + send_timeout 300s; + + # redirect server error pages / and set response status to 200 / ok + #error_page 404 =200 /; + + root /usr/share/nginx/html; + index index.html index.html; + + # Always serve index.html for any request +# location / { +# root /usr/share/nginx/html; +# try_files $uri /index.html; +# } + + # deny access to .htaccess files, if Apache's document root concurs with nginx's one + location ~ /\.ht { + deny all; + } + + # deny access to hidden files (beginning with a period) + location ~ /\. { + access_log off; log_not_found off; deny all; + } +} diff --git a/style.less b/style.less index 9ad08a87..4fda66a4 100644 --- a/style.less +++ b/style.less @@ -7,6 +7,38 @@ @import ( reference ) './css-icon.less'; @import ( less ) 'node_modules/@wikimedia/codex/dist/codex.style.css'; +/* START WbStack Customizations... */ + +/* Logo */ +.navbar-brand img { + display: none; +} + +/* Toolbar -> More Tools */ +#left-navbar > li:nth-child(3) { + display: none; +} + +/* Toolbar -> Query Builder */ +#left-navbar > li:nth-child(4) { + display: none; +} + +/* Toolbar -> Help -> Help Portal */ +.open > ul:nth-child(3) > li:nth-child(1) { + display: none; +} +/* Toolbar -> Help -> Request a Query */ +.open > ul:nth-child(3) > li:nth-child(9) { + display: none; +} +/* Toolbar -> Help -> Licencing */ +.open > ul:nth-child(3) > li:nth-child(11) { + display: none; +} + +/* END WbStack Customizations... */ + // == Colors ================================================================= // Codex “WikimediaUI” color palette // Don't use those variables directly, instead define your vars diff --git a/wikibase/config.js b/wikibase/config.js index 88a5f8ea..9acbccc0 100644 --- a/wikibase/config.js +++ b/wikibase/config.js @@ -2,6 +2,61 @@ var CONFIG = ( function ( window, $ ) { 'use strict'; + var wbstackPresets = getwbstackPresets(); + + function getwbstackPresets() { + if(window.location.pathname.substring(0,6) == '/query'){ + return { + api: { + sparql: { + uri: window.location.protocol + '//' + window.location.host + '/query/sparql' + }, + wikibase: { + uri: window.location.protocol + '//' + window.location.host + '/w/api.php' + }, + examples: { + server: window.location.protocol + '//' + window.location.host + '/', + apiPath: 'w/api.php', + pageTitle: 'Project:SPARQL/examples', + pagePathElement: 'wiki/' + } + }, + brand: { + "title": "Query Service: " + window.location.host, + // TODO fix the logo and favicon and copyright + "logo": "logo.svg", + "favicon": "favicon.ico", + "copyrightUrl": "https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/Copyright" + } + }; + } + if(window.location.host.substring(window.location.host.length-14) == 'localhost:8084'){ + return { + api: { + sparql: { + uri: window.location.protocol + '//' + window.location.host.substring(0,window.location.host.length-5) + ':8085/sparql' + }, + wikibase: { + uri: window.location.protocol + '//' + window.location.host.substring(0,window.location.host.length-5) + ':8083/w/api.php' + }, + examples: { + server: window.location.protocol + '//' + window.location.host.substring(0,window.location.host.length-5) + ':8083/', + apiPath: 'w/api.php', + pageTitle: 'Project:SPARQL/examples', + pagePathElement: 'wiki/' + } + }, + brand: { + "title": "WbStack Dev " + window.location.host.substring(0,window.location.host.length-5), + // TODO fix the logo and favicon and copyright + "logo": "logo.svg", + "favicon": "favicon.ico", + "copyrightUrl": "https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/Copyright" + } + }; + } + } + function getUserLanguage() { var lang = ( navigator.languages && navigator.languages[0] ) || navigator.language || @@ -45,7 +100,8 @@ var CONFIG = ( function ( window, $ ) { defaultConfig, customConfig; function getEffectiveConfig() { - return $.extend( true, {}, presets, defaultConfig, customConfig ); + //return $.extend( true, {}, presets, defaultConfig, customConfig ); + return $.extend( true, {}, presets, defaultConfig, customConfig, wbstackPresets ); } function onDefaultConfigLoad( config ) { diff --git a/wikibase/init.js b/wikibase/init.js index 7e8b8da8..3b31e6d2 100644 --- a/wikibase/init.js +++ b/wikibase/init.js @@ -87,7 +87,12 @@ shortenApi = new wb.api.UrlShortener( config.api.urlShortener ), languageSelector = new wb.ui.i18n.LanguageSelector( $( '.uls-trigger' ), api, lang ); - setExamplesHelpLink( querySamplesApi.getExamplesPageUrl() ); + if(window.location.host.substring(0,6) == 'query.'){ + api = new wb.api.Wikibase( window.location.protocol + '//www.' + window.location.host.substring(6) + '/w/api.php', lang ); + sparqlApi = new wb.api.Sparql(window.location.protocol + '//' + window.location.host + '/sparql', lang); + } + + setExamplesHelpLink( config.api.examples.server + config.api.examples.pagePathElement + config.api.examples.pageTitle ); var isTopWindow = window.top === window; diff --git a/wikibase/queryService/ui/App.js b/wikibase/queryService/ui/App.js index 6b054e53..5fbafb15 100644 --- a/wikibase/queryService/ui/App.js +++ b/wikibase/queryService/ui/App.js @@ -191,7 +191,9 @@ wikibase.queryService.ui.App = ( function ( $, window, _, Cookies, moment ) { this._initApp(); this._initEditor(); this._initQueryHelper(); - this._initDataUpdated(); + // WBStack EDIT START don't try to get last updated time (it won't work) + //this._initDataUpdated(); + // WBStack EDIT END this._initQuery(); this._initRdfNamespaces(); this._initHandlers(); From 60dd0e9c7766063474bc995803d81633fffb507e Mon Sep 17 00:00:00 2001 From: addshore Date: Fri, 4 Dec 2020 16:50:50 +0000 Subject: [PATCH 02/37] Github actions for docker build --- .github/workflows/docker.build.main.yml | 46 +++++++++++++++++++++++++ .github/workflows/docker.build.pr.yml | 39 +++++++++++++++++++++ .github/workflows/docker.lint.yml | 14 ++++++++ Dockerfile | 4 ++- 4 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/docker.build.main.yml create mode 100644 .github/workflows/docker.build.pr.yml create mode 100644 .github/workflows/docker.lint.yml diff --git a/.github/workflows/docker.build.main.yml b/.github/workflows/docker.build.main.yml new file mode 100644 index 00000000..3369089c --- /dev/null +++ b/.github/workflows/docker.build.main.yml @@ -0,0 +1,46 @@ +name: Docker build & push + +on: + push: + branches: wbstack + +jobs: + docker-build-and-push: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v2 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - + name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + - + name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.CR_PAT }} + - + name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile + platforms: linux/amd64 + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,mode=max,dest=/tmp/.buildx-cache + push: true + tags: | + ghcr.io/wbstack/queryservice-ui:latest \ No newline at end of file diff --git a/.github/workflows/docker.build.pr.yml b/.github/workflows/docker.build.pr.yml new file mode 100644 index 00000000..7dd31356 --- /dev/null +++ b/.github/workflows/docker.build.pr.yml @@ -0,0 +1,39 @@ +name: Docker build + +on: + pull_request: + branches: [ wbstack ] + +jobs: + docker-build: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v2 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - + name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + - + name: Build + uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile + platforms: linux/amd64 + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,mode=max,dest=/tmp/.buildx-cache + push: false + tags: | + ghcr.io/wbstack/queryservice-ui:latest \ No newline at end of file diff --git a/.github/workflows/docker.lint.yml b/.github/workflows/docker.lint.yml new file mode 100644 index 00000000..9e24d33a --- /dev/null +++ b/.github/workflows/docker.lint.yml @@ -0,0 +1,14 @@ +name: Docker lint +on: [push] +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@master + - name: lint + uses: luke142367/Docker-Lint-Action@v1.0.0 + with: + target: Dockerfile + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 042f134b..c85b9629 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,6 +13,8 @@ RUN npm run-script build FROM nginx:1-alpine +LABEL org.opencontainers.image.source="https://github.com/wbstack/queryservice-ui" -ADD ./nginx/default.conf /etc/nginx/conf.d/default.conf + +ADD ./docker/default.conf /etc/nginx/conf.d/default.conf COPY --from=builder --chown=nginx:nginx /src/app/build /usr/share/nginx/html From 83321f67ce95180a2771af16f3e7e61ff601b065 Mon Sep 17 00:00:00 2001 From: addshore Date: Sat, 5 Dec 2020 17:21:15 +0000 Subject: [PATCH 03/37] Standardize docker workflows --- .github/workflows/docker.build.pr.yml | 39 ------------------- ...docker.build.main.yml => docker.build.yml} | 22 ++++++++--- .github/workflows/docker.lint.yml | 8 +++- 3 files changed, 23 insertions(+), 46 deletions(-) delete mode 100644 .github/workflows/docker.build.pr.yml rename .github/workflows/{docker.build.main.yml => docker.build.yml} (70%) diff --git a/.github/workflows/docker.build.pr.yml b/.github/workflows/docker.build.pr.yml deleted file mode 100644 index 7dd31356..00000000 --- a/.github/workflows/docker.build.pr.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Docker build - -on: - pull_request: - branches: [ wbstack ] - -jobs: - docker-build: - runs-on: ubuntu-latest - steps: - - - name: Checkout - uses: actions/checkout@v2 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Build - uses: docker/build-push-action@v2 - with: - context: . - file: ./Dockerfile - platforms: linux/amd64 - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,mode=max,dest=/tmp/.buildx-cache - push: false - tags: | - ghcr.io/wbstack/queryservice-ui:latest \ No newline at end of file diff --git a/.github/workflows/docker.build.main.yml b/.github/workflows/docker.build.yml similarity index 70% rename from .github/workflows/docker.build.main.yml rename to .github/workflows/docker.build.yml index 3369089c..3f4bff3e 100644 --- a/.github/workflows/docker.build.main.yml +++ b/.github/workflows/docker.build.yml @@ -1,16 +1,26 @@ -name: Docker build & push +name: Docker build on: push: - branches: wbstack + branches: + - 'main' + tags: + - '*' + pull_request: jobs: - docker-build-and-push: + docker-build: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 + - + name: Docker meta + id: docker_meta + uses: crazy-max/ghaction-docker-meta@v1 + with: + images: ghcr.io/${{ github.repository }} - name: Set up QEMU uses: docker/setup-qemu-action@v1 @@ -41,6 +51,6 @@ jobs: platforms: linux/amd64 cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,mode=max,dest=/tmp/.buildx-cache - push: true - tags: | - ghcr.io/wbstack/queryservice-ui:latest \ No newline at end of file + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.docker_meta.outputs.tags }} + labels: ${{ steps.docker_meta.outputs.labels }} \ No newline at end of file diff --git a/.github/workflows/docker.lint.yml b/.github/workflows/docker.lint.yml index 9e24d33a..30e9f841 100644 --- a/.github/workflows/docker.lint.yml +++ b/.github/workflows/docker.lint.yml @@ -1,5 +1,11 @@ name: Docker lint -on: [push] + +on: + push: + branches: + - 'main' + pull_request: + jobs: lint: runs-on: ubuntu-latest From c8191b103b44ba26af7bbcd5a35b29d9009e8439 Mon Sep 17 00:00:00 2001 From: addshore Date: Sat, 5 Dec 2020 17:50:55 +0000 Subject: [PATCH 04/37] ADD CHANGELOG.md --- CHANGELOG.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..4054c34f --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,40 @@ +# queryservice-ui + +## December 2020 + +- 1.0 - Github Build (first) + +## May 2020 + +- 0.26 - Build: remove more non modified files from wbstack git (pt2) +- 0.25 - git pull, (2 may 2020) +- 0.21 - Build: without having all code files in wbstack git + +## April 2029 + +- 0.20 - git pull, (17 April 2020) +- 0.19 - git pull, (5 April 2020) + +## December 2019 + +- 0.18 - git pull, should fix https://github.com/addshore/wbstack/issues/32 ([edit] in examples) + +## November 2019 + +- 0.17 - 2x XSS fixes +- 0.16 - Help examples link fix / rewrite on load +- 0.15 - Examples button +- 0.14 - Tidy up after security fix +- 0.13 - SECURITY fix - https://phabricator.wikimedia.org/T233213 (XSS in math) + +## October 2019 + +- 0.12 - THURSDAY, tiny fix to title +- 0.11 - THURSDAY, fix config generation (missing first /) +- 0.10 - Wednesday before Wikidatacon +- 0.6 - Better dev localhost stuff +- 0.5 - Don't try to get last updated time (it wont work) +- 0.4 - Also allow sparql and wikibase config for localhost development +- 0.3 - CSS hacks to make the UI smaller and remove wikidata things +- 0.2 - sparql and wikibase API based on request host +- 0.1 - Initial version. From 9e1c7c7f46badadead0e979fe41c537d8e7a8217 Mon Sep 17 00:00:00 2001 From: addshore Date: Tue, 8 Dec 2020 22:16:45 +0000 Subject: [PATCH 05/37] CHANGELOG for 1.1 image --- CHANGELOG.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4054c34f..28790a60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,12 @@ -# queryservice-ui +# WBStack queryservice-ui -## December 2020 +## 1.1 -- 1.0 - Github Build (first) +December 2020 updates from upstream. [PR](https://github.com/wbstack/queryservice-ui/pull/1) + +## 1.0 + +Github Build (first) ## May 2020 From 64c67330f3cbdf3c2e206eb5c0374f3b47450f97 Mon Sep 17 00:00:00 2001 From: addshore Date: Sun, 31 Jan 2021 13:09:02 +0000 Subject: [PATCH 06/37] CHANGELOG for 1.2 --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 28790a60..2e8123c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # WBStack queryservice-ui +## 1.2 + +January 2021 updates from upstream. + ## 1.1 December 2020 updates from upstream. [PR](https://github.com/wbstack/queryservice-ui/pull/1) From 1f1c98e87de1d9987020731c3d54f85cad79ce5f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 2 May 2021 16:59:20 +0000 Subject: [PATCH 07/37] Bump luke142367/Docker-Lint-Action from v1.0.0 to v1.1.1 Bumps [luke142367/Docker-Lint-Action](https://github.com/luke142367/Docker-Lint-Action) from v1.0.0 to v1.1.1. - [Release notes](https://github.com/luke142367/Docker-Lint-Action/releases) - [Commits](https://github.com/luke142367/Docker-Lint-Action/compare/v1.0.0...5c4c86226f39785a66827bbc2e322600c9afa3a9) Signed-off-by: dependabot[bot] --- .github/workflows/docker.lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.lint.yml b/.github/workflows/docker.lint.yml index 30e9f841..047204c7 100644 --- a/.github/workflows/docker.lint.yml +++ b/.github/workflows/docker.lint.yml @@ -13,7 +13,7 @@ jobs: - name: Checkout uses: actions/checkout@master - name: lint - uses: luke142367/Docker-Lint-Action@v1.0.0 + uses: luke142367/Docker-Lint-Action@v1.1.1 with: target: Dockerfile env: From 2382940ebf9c20a492e7fa5335da209457ad722f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 2 May 2021 16:59:23 +0000 Subject: [PATCH 08/37] Bump crazy-max/ghaction-docker-meta from v1 to v2.4.0 Bumps [crazy-max/ghaction-docker-meta](https://github.com/crazy-max/ghaction-docker-meta) from v1 to v2.4.0. - [Release notes](https://github.com/crazy-max/ghaction-docker-meta/releases) - [Changelog](https://github.com/crazy-max/ghaction-docker-meta/blob/master/CHANGELOG.md) - [Commits](https://github.com/crazy-max/ghaction-docker-meta/compare/v1...e09df4df3ce0f1198fcfa91b72743b2cb7969430) Signed-off-by: dependabot[bot] --- .github/workflows/docker.build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.build.yml b/.github/workflows/docker.build.yml index 3f4bff3e..78083fdc 100644 --- a/.github/workflows/docker.build.yml +++ b/.github/workflows/docker.build.yml @@ -18,7 +18,7 @@ jobs: - name: Docker meta id: docker_meta - uses: crazy-max/ghaction-docker-meta@v1 + uses: crazy-max/ghaction-docker-meta@v2.4.0 with: images: ghcr.io/${{ github.repository }} - From 61b2f42f3e411f9f5e233736ed68ba95f586491f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 14 May 2021 09:02:07 +0100 Subject: [PATCH 09/37] Bump actions/cache from 2 to 2.1.5 (#18) Bumps [actions/cache](https://github.com/actions/cache) from 2 to 2.1.5. - [Release notes](https://github.com/actions/cache/releases) - [Commits](https://github.com/actions/cache/compare/v2...v2.1.5) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/docker.build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.build.yml b/.github/workflows/docker.build.yml index 78083fdc..d3aaf6c2 100644 --- a/.github/workflows/docker.build.yml +++ b/.github/workflows/docker.build.yml @@ -29,7 +29,7 @@ jobs: uses: docker/setup-buildx-action@v1 - name: Cache Docker layers - uses: actions/cache@v2 + uses: actions/cache@v2.1.5 with: path: /tmp/.buildx-cache key: ${{ runner.os }}-buildx-${{ github.sha }} From e2829dcefd0d744c521229da714302e319663295 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 14 May 2021 09:02:15 +0100 Subject: [PATCH 10/37] Bump docker/setup-qemu-action from 1 to 1.1.0 (#17) Bumps [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) from 1 to 1.1.0. - [Release notes](https://github.com/docker/setup-qemu-action/releases) - [Commits](https://github.com/docker/setup-qemu-action/compare/v1...v1.1.0) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/docker.build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.build.yml b/.github/workflows/docker.build.yml index d3aaf6c2..ab762340 100644 --- a/.github/workflows/docker.build.yml +++ b/.github/workflows/docker.build.yml @@ -23,7 +23,7 @@ jobs: images: ghcr.io/${{ github.repository }} - name: Set up QEMU - uses: docker/setup-qemu-action@v1 + uses: docker/setup-qemu-action@v1.1.0 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 From 66eeabbd4e018bdcdaa5a1011a36b19c116099cd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 14 May 2021 09:02:39 +0100 Subject: [PATCH 11/37] Bump docker/build-push-action from 2 to 2.4.0 (#15) Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 2 to 2.4.0. - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/v2...v2.4.0) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/docker.build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.build.yml b/.github/workflows/docker.build.yml index ab762340..88d72a8d 100644 --- a/.github/workflows/docker.build.yml +++ b/.github/workflows/docker.build.yml @@ -44,7 +44,7 @@ jobs: password: ${{ secrets.CR_PAT }} - name: Build and push - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v2.4.0 with: context: . file: ./Dockerfile From e660fa696e8586aec781a6c0af47e3c6f2846978 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 14 May 2021 09:02:46 +0100 Subject: [PATCH 12/37] Bump crazy-max/ghaction-docker-meta from 2.4.0 to 3.1.0 (#14) Bumps [crazy-max/ghaction-docker-meta](https://github.com/crazy-max/ghaction-docker-meta) from 2.4.0 to 3.1.0. - [Release notes](https://github.com/crazy-max/ghaction-docker-meta/releases) - [Upgrade guide](https://github.com/docker/metadata-action/blob/master/UPGRADE.md) - [Commits](https://github.com/crazy-max/ghaction-docker-meta/compare/v2.4.0...v3.1.0) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/docker.build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.build.yml b/.github/workflows/docker.build.yml index 88d72a8d..e8841164 100644 --- a/.github/workflows/docker.build.yml +++ b/.github/workflows/docker.build.yml @@ -18,7 +18,7 @@ jobs: - name: Docker meta id: docker_meta - uses: crazy-max/ghaction-docker-meta@v2.4.0 + uses: crazy-max/ghaction-docker-meta@v3.1.0 with: images: ghcr.io/${{ github.repository }} - From ff6e0aa4a412198e66fb64e8e2a7e6cb84c9cb0d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 14 May 2021 09:02:53 +0100 Subject: [PATCH 13/37] Bump docker/login-action from 1 to 1.9.0 (#13) Bumps [docker/login-action](https://github.com/docker/login-action) from 1 to 1.9.0. - [Release notes](https://github.com/docker/login-action/releases) - [Commits](https://github.com/docker/login-action/compare/v1...v1.9.0) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/docker.build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.build.yml b/.github/workflows/docker.build.yml index e8841164..eaf607f7 100644 --- a/.github/workflows/docker.build.yml +++ b/.github/workflows/docker.build.yml @@ -37,7 +37,7 @@ jobs: ${{ runner.os }}-buildx- - name: Login to GitHub Container Registry - uses: docker/login-action@v1 + uses: docker/login-action@v1.9.0 with: registry: ghcr.io username: ${{ github.repository_owner }} From 1ad072396b202b76de57ab772721f5772fcc42d8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 14 May 2021 09:03:01 +0100 Subject: [PATCH 14/37] Bump actions/checkout from 2 to 2.3.4 (#12) Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 2.3.4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v2...v2.3.4) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/docker.build.yml | 2 +- .github/workflows/docker.lint.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.build.yml b/.github/workflows/docker.build.yml index eaf607f7..f1c8f417 100644 --- a/.github/workflows/docker.build.yml +++ b/.github/workflows/docker.build.yml @@ -14,7 +14,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v2.3.4 - name: Docker meta id: docker_meta diff --git a/.github/workflows/docker.lint.yml b/.github/workflows/docker.lint.yml index 047204c7..ee441e2d 100644 --- a/.github/workflows/docker.lint.yml +++ b/.github/workflows/docker.lint.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@master + uses: actions/checkout@v2.3.4 - name: lint uses: luke142367/Docker-Lint-Action@v1.1.1 with: From 8fd1aae7dd2998bc4d0f27e60e2ee4fb2a987ad8 Mon Sep 17 00:00:00 2001 From: addshore Date: Fri, 14 May 2021 13:42:19 +0100 Subject: [PATCH 15/37] Don't require GITHUB_TOKEN in docker related flows (#19) * Don't require GITHUB_TOKEN in docker related flows * Dockerfile, use ADD instead of COPY --- .github/workflows/docker.build.yml | 5 +++-- .github/workflows/docker.lint.yml | 6 ++---- Dockerfile | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docker.build.yml b/.github/workflows/docker.build.yml index f1c8f417..22e252bb 100644 --- a/.github/workflows/docker.build.yml +++ b/.github/workflows/docker.build.yml @@ -26,7 +26,7 @@ jobs: uses: docker/setup-qemu-action@v1.1.0 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v1.3.0 - name: Cache Docker layers uses: actions/cache@v2.1.5 @@ -37,7 +37,8 @@ jobs: ${{ runner.os }}-buildx- - name: Login to GitHub Container Registry - uses: docker/login-action@v1.9.0 + uses: docker/login-action@v1.9.0 + if: github.event_name != 'pull_request' with: registry: ghcr.io username: ${{ github.repository_owner }} diff --git a/.github/workflows/docker.lint.yml b/.github/workflows/docker.lint.yml index ee441e2d..c42420d5 100644 --- a/.github/workflows/docker.lint.yml +++ b/.github/workflows/docker.lint.yml @@ -13,8 +13,6 @@ jobs: - name: Checkout uses: actions/checkout@v2.3.4 - name: lint - uses: luke142367/Docker-Lint-Action@v1.1.1 + uses: hadolint/hadolint-action@v1.5.0 with: - target: Dockerfile - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + dockerfile: Dockerfile \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index c85b9629..1f5f9496 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,5 +16,5 @@ FROM nginx:1-alpine LABEL org.opencontainers.image.source="https://github.com/wbstack/queryservice-ui" -ADD ./docker/default.conf /etc/nginx/conf.d/default.conf +COPY ./docker/default.conf /etc/nginx/conf.d/default.conf COPY --from=builder --chown=nginx:nginx /src/app/build /usr/share/nginx/html From 42dc57063bfc4d9e1d9989d09c3ffd0fc5def751 Mon Sep 17 00:00:00 2001 From: addshore Date: Wed, 23 Jun 2021 21:58:12 +0100 Subject: [PATCH 16/37] CHANGELOG 1.3 --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e8123c7..4783d432 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # WBStack queryservice-ui +## 1.3 + +June 2021 updates from upstream. + ## 1.2 January 2021 updates from upstream. From 51c34eee3f9c8d769895818fa9d8213827438b3f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 23 Jun 2021 22:00:18 +0100 Subject: [PATCH 17/37] Bump crazy-max/ghaction-docker-meta from 3.1.0 to 3.3.0 (#21) Bumps [crazy-max/ghaction-docker-meta](https://github.com/crazy-max/ghaction-docker-meta) from 3.1.0 to 3.3.0. - [Release notes](https://github.com/crazy-max/ghaction-docker-meta/releases) - [Commits](https://github.com/crazy-max/ghaction-docker-meta/compare/v3.1.0...v3.3.0) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/docker.build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.build.yml b/.github/workflows/docker.build.yml index 22e252bb..f680a005 100644 --- a/.github/workflows/docker.build.yml +++ b/.github/workflows/docker.build.yml @@ -18,7 +18,7 @@ jobs: - name: Docker meta id: docker_meta - uses: crazy-max/ghaction-docker-meta@v3.1.0 + uses: crazy-max/ghaction-docker-meta@v3.3.0 with: images: ghcr.io/${{ github.repository }} - From 3bec0f6f60bedbacf704495afa3b75e2a990c600 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 23 Jun 2021 22:00:30 +0100 Subject: [PATCH 18/37] Bump docker/build-push-action from 2.4.0 to 2.5.0 (#22) Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 2.4.0 to 2.5.0. - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/v2.4.0...v2.5.0) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/docker.build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.build.yml b/.github/workflows/docker.build.yml index f680a005..8bec965b 100644 --- a/.github/workflows/docker.build.yml +++ b/.github/workflows/docker.build.yml @@ -45,7 +45,7 @@ jobs: password: ${{ secrets.CR_PAT }} - name: Build and push - uses: docker/build-push-action@v2.4.0 + uses: docker/build-push-action@v2.5.0 with: context: . file: ./Dockerfile From a62e1441942fd468341edb971561239b900e2fb9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 23 Jun 2021 22:00:39 +0100 Subject: [PATCH 19/37] Bump docker/setup-qemu-action from 1.1.0 to 1.2.0 (#23) Bumps [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) from 1.1.0 to 1.2.0. - [Release notes](https://github.com/docker/setup-qemu-action/releases) - [Commits](https://github.com/docker/setup-qemu-action/compare/v1.1.0...v1.2.0) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/docker.build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.build.yml b/.github/workflows/docker.build.yml index 8bec965b..13841946 100644 --- a/.github/workflows/docker.build.yml +++ b/.github/workflows/docker.build.yml @@ -23,7 +23,7 @@ jobs: images: ghcr.io/${{ github.repository }} - name: Set up QEMU - uses: docker/setup-qemu-action@v1.1.0 + uses: docker/setup-qemu-action@v1.2.0 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1.3.0 From 92a9ecef6c1098c37077403daa191b40f586d575 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 23 Jun 2021 22:00:50 +0100 Subject: [PATCH 20/37] Bump actions/cache from 2.1.5 to 2.1.6 (#24) Bumps [actions/cache](https://github.com/actions/cache) from 2.1.5 to 2.1.6. - [Release notes](https://github.com/actions/cache/releases) - [Commits](https://github.com/actions/cache/compare/v2.1.5...v2.1.6) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/docker.build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.build.yml b/.github/workflows/docker.build.yml index 13841946..c86c29ba 100644 --- a/.github/workflows/docker.build.yml +++ b/.github/workflows/docker.build.yml @@ -29,7 +29,7 @@ jobs: uses: docker/setup-buildx-action@v1.3.0 - name: Cache Docker layers - uses: actions/cache@v2.1.5 + uses: actions/cache@v2.1.6 with: path: /tmp/.buildx-cache key: ${{ runner.os }}-buildx-${{ github.sha }} From 6feebb0eab11de5fec5b397f4fa09e3e892039f4 Mon Sep 17 00:00:00 2001 From: addshore Date: Wed, 30 Jun 2021 20:28:40 +0100 Subject: [PATCH 21/37] Dependapile Github Actions June 30th (#28) * Bump docker/login-action from 1.9.0 to 1.10.0 (#26) Bumps [docker/login-action](https://github.com/docker/login-action) from 1.9.0 to 1.10.0. - [Release notes](https://github.com/docker/login-action/releases) - [Commits](https://github.com/docker/login-action/compare/v1.9.0...v1.10.0) --- updated-dependencies: - dependency-name: docker/login-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump docker/setup-buildx-action from 1.3.0 to 1.4.1 (#27) Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 1.3.0 to 1.4.1. - [Release notes](https://github.com/docker/setup-buildx-action/releases) - [Commits](https://github.com/docker/setup-buildx-action/compare/v1.3.0...v1.4.1) --- updated-dependencies: - dependency-name: docker/setup-buildx-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/docker.build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.build.yml b/.github/workflows/docker.build.yml index c86c29ba..b4878119 100644 --- a/.github/workflows/docker.build.yml +++ b/.github/workflows/docker.build.yml @@ -26,7 +26,7 @@ jobs: uses: docker/setup-qemu-action@v1.2.0 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1.3.0 + uses: docker/setup-buildx-action@v1.4.1 - name: Cache Docker layers uses: actions/cache@v2.1.6 @@ -37,7 +37,7 @@ jobs: ${{ runner.os }}-buildx- - name: Login to GitHub Container Registry - uses: docker/login-action@v1.9.0 + uses: docker/login-action@v1.10.0 if: github.event_name != 'pull_request' with: registry: ghcr.io From 0404422da1f6438f4f8301109e08b86db50c5753 Mon Sep 17 00:00:00 2001 From: addshore Date: Wed, 1 Sep 2021 11:05:14 +0100 Subject: [PATCH 22/37] Add .github/workflows/github.prs.combine.yml --- .github/workflows/github.prs.combine.yml | 136 +++++++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 .github/workflows/github.prs.combine.yml diff --git a/.github/workflows/github.prs.combine.yml b/.github/workflows/github.prs.combine.yml new file mode 100644 index 00000000..9172d6d2 --- /dev/null +++ b/.github/workflows/github.prs.combine.yml @@ -0,0 +1,136 @@ +# From https://github.com/testcontainers/testcontainers-java/blob/master/.github/workflows/combine-prs.yml +name: 'Combine PRs' + +# Controls when the action will run - in this case triggered manually +on: + workflow_dispatch: + inputs: + branchPrefix: + description: 'Branch prefix to find combinable PRs based on' + required: true + default: 'dependabot' + mustBeGreen: + description: 'Only combine PRs that are green (status is success)' + required: true + default: 'true' + combineBranchName: + description: 'Name of the branch to combine PRs into' + required: true + default: 'combine-prs-branch' + ignoreLabel: + description: 'Exclude PRs with this label' + required: true + default: 'nocombine' + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "combine-prs" + combine-prs: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + - uses: actions/github-script@v4.1 + id: fetch-branch-names + name: Fetch branch names + with: + github-token: ${{secrets.GH_TOKEN_PLUSW}} + script: | + const pulls = await github.paginate('GET /repos/:owner/:repo/pulls', { + owner: context.repo.owner, + repo: context.repo.repo + }); + branches = []; + prs = []; + base_branch = null; + for (const pull of pulls) { + const branch = pull['head']['ref']; + console.log('Pull for branch: ' + branch); + if (branch.startsWith('${{ github.event.inputs.branchPrefix }}')) { + console.log('Branch matched: ' + branch); + statusOK = true; + if(${{ github.event.inputs.mustBeGreen }}) { + console.log('Checking green status: ' + branch); + const checkRuns = await github.request('GET /repos/{owner}/{repo}/commits/{ref}/check-runs', { + owner: context.repo.owner, + repo: context.repo.repo, + ref: branch + }); + for await (const cr of checkRuns.data.check_runs) { + console.log('Validating check conclusion: ' + cr.conclusion); + if(cr.conclusion != 'success') { + console.log('Discarding ' + branch + ' with check conclusion ' + cr.conclusion); + statusOK = false; + } + } + } + console.log('Checking labels: ' + branch); + const labels = pull['labels']; + for(const label of labels) { + const labelName = label['name']; + console.log('Checking label: ' + labelName); + if(labelName == '${{ github.event.inputs.ignoreLabel }}') { + console.log('Discarding ' + branch + ' with label ' + labelName); + statusOK = false; + } + } + if (statusOK) { + console.log('Adding branch to array: ' + branch); + branches.push(branch); + prs.push('#' + pull['number'] + ' ' + pull['title']); + base_branch = pull['base']['ref']; + } + } + } + if (branches.length == 0) { + core.setFailed('No PRs/branches matched criteria'); + return; + } + core.setOutput('base-branch', base_branch); + core.setOutput('prs-string', prs.join('\n')); + combined = branches.join(' ') + console.log('Combined: ' + combined); + return combined + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2.3.3 + with: + fetch-depth: 0 + token: ${{ secrets.GH_TOKEN_PLUSW }} + # Creates a branch with other PR branches merged together + - name: Created combined branch + env: + BASE_BRANCH: ${{ steps.fetch-branch-names.outputs.base-branch }} + BRANCHES_TO_COMBINE: ${{ steps.fetch-branch-names.outputs.result }} + COMBINE_BRANCH_NAME: ${{ github.event.inputs.combineBranchName }} + run: | + echo "$BRANCHES_TO_COMBINE" + sourcebranches="${BRANCHES_TO_COMBINE%\"}" + sourcebranches="${sourcebranches#\"}" + basebranch="${BASE_BRANCH%\"}" + basebranch="${basebranch#\"}" + git config pull.rebase false + git config user.name github-actions + git config user.email github-actions@github.com + git branch $COMBINE_BRANCH_NAME $basebranch + git checkout $COMBINE_BRANCH_NAME + git pull origin $sourcebranches --no-edit + git push origin $COMBINE_BRANCH_NAME --force-with-lease + # Creates a PR with the new combined branch + - uses: actions/github-script@v4.1 + name: Create Combined Pull Request + env: + PRS_STRING: ${{ steps.fetch-branch-names.outputs.prs-string }} + with: + github-token: ${{secrets.GH_TOKEN_PLUSW}} + script: | + const prString = process.env.PRS_STRING; + const body = 'This PR was created by the Combine PRs action by combining the following PRs:\n' + prString; + await github.pulls.create({ + owner: context.repo.owner, + repo: context.repo.repo, + title: 'Combined PR for prefix: ${{ github.event.inputs.branchPrefix }}', + head: '${{ github.event.inputs.combineBranchName }}', + base: '${{ steps.fetch-branch-names.outputs.base-branch }}', + body: body + }); From d3935eb3f68f943f9519a3046ece0f6bceee25ae Mon Sep 17 00:00:00 2001 From: addshore Date: Wed, 1 Sep 2021 13:20:50 +0100 Subject: [PATCH 23/37] Combined PR for prefix: dependabot/github_actions (#37) * Bump docker/setup-buildx-action from 1.4.1 to 1.5.1 Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 1.4.1 to 1.5.1. - [Release notes](https://github.com/docker/setup-buildx-action/releases) - [Commits](https://github.com/docker/setup-buildx-action/compare/v1.4.1...v1.5.1) --- updated-dependencies: - dependency-name: docker/setup-buildx-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Bump docker/build-push-action from 2.5.0 to 2.7.0 Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 2.5.0 to 2.7.0. - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/v2.5.0...v2.7.0) --- updated-dependencies: - dependency-name: docker/build-push-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Bump crazy-max/ghaction-docker-meta from 3.3.0 to 3.5.0 Bumps [crazy-max/ghaction-docker-meta](https://github.com/crazy-max/ghaction-docker-meta) from 3.3.0 to 3.5.0. - [Release notes](https://github.com/crazy-max/ghaction-docker-meta/releases) - [Commits](https://github.com/crazy-max/ghaction-docker-meta/compare/v3.3.0...v3.5.0) --- updated-dependencies: - dependency-name: crazy-max/ghaction-docker-meta dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Bump hadolint/hadolint-action from 1.5.0 to 1.6.0 Bumps [hadolint/hadolint-action](https://github.com/hadolint/hadolint-action) from 1.5.0 to 1.6.0. - [Release notes](https://github.com/hadolint/hadolint-action/releases) - [Changelog](https://github.com/hadolint/hadolint-action/blob/master/.releaserc) - [Commits](https://github.com/hadolint/hadolint-action/compare/v1.5.0...v1.6.0) --- updated-dependencies: - dependency-name: hadolint/hadolint-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions --- .github/workflows/docker.build.yml | 6 +++--- .github/workflows/docker.lint.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker.build.yml b/.github/workflows/docker.build.yml index b4878119..abe4958a 100644 --- a/.github/workflows/docker.build.yml +++ b/.github/workflows/docker.build.yml @@ -18,7 +18,7 @@ jobs: - name: Docker meta id: docker_meta - uses: crazy-max/ghaction-docker-meta@v3.3.0 + uses: crazy-max/ghaction-docker-meta@v3.5.0 with: images: ghcr.io/${{ github.repository }} - @@ -26,7 +26,7 @@ jobs: uses: docker/setup-qemu-action@v1.2.0 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1.4.1 + uses: docker/setup-buildx-action@v1.5.1 - name: Cache Docker layers uses: actions/cache@v2.1.6 @@ -45,7 +45,7 @@ jobs: password: ${{ secrets.CR_PAT }} - name: Build and push - uses: docker/build-push-action@v2.5.0 + uses: docker/build-push-action@v2.7.0 with: context: . file: ./Dockerfile diff --git a/.github/workflows/docker.lint.yml b/.github/workflows/docker.lint.yml index c42420d5..429940ac 100644 --- a/.github/workflows/docker.lint.yml +++ b/.github/workflows/docker.lint.yml @@ -13,6 +13,6 @@ jobs: - name: Checkout uses: actions/checkout@v2.3.4 - name: lint - uses: hadolint/hadolint-action@v1.5.0 + uses: hadolint/hadolint-action@v1.6.0 with: dockerfile: Dockerfile \ No newline at end of file From 648afdf9e4a52d91a87803c4a9b4122c071b09ac Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 13 Oct 2021 14:19:44 +0100 Subject: [PATCH 24/37] Bump actions/github-script from 4.1 to 5 (#39) Bumps [actions/github-script](https://github.com/actions/github-script) from 4.1 to 5. - [Release notes](https://github.com/actions/github-script/releases) - [Commits](https://github.com/actions/github-script/compare/v4.1...v5) --- updated-dependencies: - dependency-name: actions/github-script dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/github.prs.combine.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github.prs.combine.yml b/.github/workflows/github.prs.combine.yml index 9172d6d2..3a3973a6 100644 --- a/.github/workflows/github.prs.combine.yml +++ b/.github/workflows/github.prs.combine.yml @@ -31,7 +31,7 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: - - uses: actions/github-script@v4.1 + - uses: actions/github-script@v5 id: fetch-branch-names name: Fetch branch names with: @@ -117,7 +117,7 @@ jobs: git pull origin $sourcebranches --no-edit git push origin $COMBINE_BRANCH_NAME --force-with-lease # Creates a PR with the new combined branch - - uses: actions/github-script@v4.1 + - uses: actions/github-script@v5 name: Create Combined Pull Request env: PRS_STRING: ${{ steps.fetch-branch-names.outputs.prs-string }} From 056ef97b5ec5c82b24bc553f733ce633dfc9efe5 Mon Sep 17 00:00:00 2001 From: addshore Date: Wed, 13 Oct 2021 13:53:37 +0100 Subject: [PATCH 25/37] Blanket ${{ secrets.GITHUB_TOKEN }} --- .github/workflows/docker.build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.build.yml b/.github/workflows/docker.build.yml index abe4958a..3ddd3d35 100644 --- a/.github/workflows/docker.build.yml +++ b/.github/workflows/docker.build.yml @@ -42,7 +42,7 @@ jobs: with: registry: ghcr.io username: ${{ github.repository_owner }} - password: ${{ secrets.CR_PAT }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push uses: docker/build-push-action@v2.7.0 From 0fcbba7948bac348fa2c34070c7f5c461a1a3982 Mon Sep 17 00:00:00 2001 From: Thomas Arrow Date: Thu, 10 Feb 2022 16:00:30 +0000 Subject: [PATCH 26/37] CHANGELOG: 1.4 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4783d432..9f0f4d59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # WBStack queryservice-ui +## 1.4 + +February 2022 updates from upstream. +Security patches. +Includes hotfix until upstream [bug](https://phabricator.wikimedia.org/T301255) is resolved + ## 1.3 June 2021 updates from upstream. From 00161f98fa93b43c4413fae7994b5a761d24ceb6 Mon Sep 17 00:00:00 2001 From: Frederik Ring Date: Mon, 29 Jan 2024 10:44:54 +0100 Subject: [PATCH 27/37] fix: do not try to clean prefixes at all --- .../ui/queryHelper/QueryHelper.js | 34 +------------------ 1 file changed, 1 insertion(+), 33 deletions(-) diff --git a/wikibase/queryService/ui/queryHelper/QueryHelper.js b/wikibase/queryService/ui/queryHelper/QueryHelper.js index ccd8ef85..ed260ace 100644 --- a/wikibase/queryService/ui/queryHelper/QueryHelper.js +++ b/wikibase/queryService/ui/queryHelper/QueryHelper.js @@ -91,44 +91,12 @@ wikibase.queryService.ui.queryHelper.QueryHelper = ( function ( $, wikibase, _ ) */ SELF.prototype.getQuery = function () { try { - var q = this._query.getQueryString(); - q = this._cleanQueryPrefixes( q ).trim(); - return q.trim(); + return this._query.getQueryString().trim(); } catch ( e ) { return null; } }; - /** - * Workaround for https://phabricator.wikimedia.org/T133316 - * - * @private - */ - SELF.prototype._cleanQueryPrefixes = function ( query ) { - var prefixRegex = new RegExp( 'PREFIX (' + wikibase.queryService.VariableNames.PrefixPattern + '): <(.*)>', 'gi' ), - m, - prefixes = {}, - cleanQuery = query.replace( prefixRegex, '' ).replace( /\n+/g, '\n' ); - - while ( ( m = prefixRegex.exec( query ) ) ) { - var prefix = m[1]; - var uri = m[2].replace( /[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&' ); - - var newQuery = cleanQuery.replace( new RegExp( '<' + uri + '([^/>#]+?)>', 'gi' ), - prefix + ':$1' ); - - if ( cleanQuery !== newQuery ) { - cleanQuery = newQuery; - if ( !wikibase.queryService.RdfNamespaces.STANDARD_PREFIXES[prefix] ) { - prefixes[m[0]] = true; - } - } - } - - cleanQuery = Object.keys( prefixes ).join( '\n' ) + '\n\n' + cleanQuery.trim(); - return cleanQuery; - }; - /** * Draw visual editor to given element * From a5c2a7f686b10a73ec84a467044ee84f898d4aaa Mon Sep 17 00:00:00 2001 From: Frederik Ring Date: Tue, 30 Jan 2024 10:14:21 +0100 Subject: [PATCH 28/37] docs: add CHANGELOG --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f0f4d59..f9966bad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # WBStack queryservice-ui +## 1.5 + +Remove custom cleaning of prefixes on Query Formatting (https://phabricator.wikimedia.org/T347023) + ## 1.4 February 2022 updates from upstream. From f32c24466ec59e9213c211d307ed1ade1367888f Mon Sep 17 00:00:00 2001 From: Deniz Erdogan <91744937+deer-wmde@users.noreply.github.com> Date: Fri, 9 Feb 2024 11:47:29 +0100 Subject: [PATCH 29/37] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 94ad7c3f..55e36e71 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ +> ℹ️ Issues for this repository are tracked on [Phabricator](https://phabricator.wikimedia.org/project/board/5563/) - ([Click here to open a new one](https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?tags=wikibase_cloud +)) + # Wikibase Query Service GUI This repository contains the GUI for the [Wikidata Query Service](https://query.wikidata.org/). From 75df67b09ce8f2b24f9e98cff2228650f71f2f9a Mon Sep 17 00:00:00 2001 From: Andrew Kostka Date: Wed, 30 Oct 2024 15:19:49 +0000 Subject: [PATCH 30/37] Improve TinyURL shortener --- wikibase/queryService/api/UrlShortener.js | 28 +++++++++++++++++------ wikibase/queryService/ui/App.js | 7 ++++++ 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/wikibase/queryService/api/UrlShortener.js b/wikibase/queryService/api/UrlShortener.js index 602272ea..26bb41cf 100644 --- a/wikibase/queryService/api/UrlShortener.js +++ b/wikibase/queryService/api/UrlShortener.js @@ -84,14 +84,28 @@ wikibase.queryService.api.UrlShortener = ( function ( $ ) { /** @return {string} HTML */ SELF.prototype._getTinyUrl = function ( url ) { - var TINYURL_API = '//tinyurl.com/api-create.php?url='; + var base64Url = new URL( url ); + base64Url.searchParams.append( 'base64', true ); + base64Url.hash = btoa( base64Url.hash ); - return ''; + var deferred = $.Deferred(); + $.ajax( { + 'method': 'POST', + 'url': 'https://tinyurl.com/api-create.php', + 'data': jQuery.param({ 'url': base64Url.toString() }) + } ).done( function( text ) { + var text, html, $element; + html = '
' + htmlEscape( text ) + '
'; + $element = $( '