From 5d73df67ee0731f372df9a4a0464182a6411e1fe Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Mon, 29 Oct 2018 10:23:01 +0100
Subject: [PATCH 001/942] Bump React and chrome-remote-interface NPM
dependencies
Closes #49
---
package.json | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/package.json b/package.json
index ae2f5a8..43c1761 100644
--- a/package.json
+++ b/package.json
@@ -17,7 +17,7 @@
"@babel/preset-react": "^7.0.0",
"babel-eslint": "^9.0.0",
"babel-loader": "^8.0.0",
- "chrome-remote-interface": "^0.25.5",
+ "chrome-remote-interface": "^0.26.1",
"compression-webpack-plugin": "^1.1.11",
"copy-webpack-plugin": "^4.5.2",
"css-loader": "^0.28.11",
@@ -44,7 +44,7 @@
"dependencies": {
"@babel/polyfill": "^7.0.0",
"node-sass": "^4.9.0",
- "react": "^16.4.2",
- "react-dom": "^16.4.2"
+ "react": "^16.6.0",
+ "react-dom": "^16.6.0"
}
}
From bb541d7506ae2b0f2fad4955dfea47f0a9005916 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Thu, 8 Nov 2018 13:47:06 +0100
Subject: [PATCH 002/942] Bump Cockpit test API to 181
No API changes.
Closes #52
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 6bd672c..5f959c4 100644
--- a/Makefile
+++ b/Makefile
@@ -139,7 +139,7 @@ bots:
# checkout Cockpit's test API; this has no API stability guarantee, so check out a stable tag
# when you start a new project, use the latest relese, and update it from time to time
test/common:
- git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 176
+ git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 181
git checkout --force FETCH_HEAD -- test/common
git reset test/common
From 9e09cfb77f2ce847eb984c17d21bf30a4be1361a Mon Sep 17 00:00:00 2001
From: Marius Vollmer
Date: Thu, 8 Nov 2018 13:02:03 +0200
Subject: [PATCH 003/942] Ask the Cockpit Bots to propose updates for NPM
modules
---
.tasks | 7 +++++++
1 file changed, 7 insertions(+)
create mode 100755 .tasks
diff --git a/.tasks b/.tasks
new file mode 100755
index 0000000..8da62e5
--- /dev/null
+++ b/.tasks
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+# Open issues for things that need doing on a regular basis
+bots/npm-trigger
+
+# Find those issues and propose to do them
+bots/issue-scan
From c87b2839c11eaac09e80f0b1f33910dea16db5e1 Mon Sep 17 00:00:00 2001
From: Marius Vollmer
Date: Thu, 22 Nov 2018 10:56:00 +0200
Subject: [PATCH 004/942] Use specific versions in package.json
The Cockpit Bots will now propose updates.
Closes #54
---
package.json | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/package.json b/package.json
index 43c1761..5a1cde2 100644
--- a/package.json
+++ b/package.json
@@ -42,9 +42,9 @@
"webpack-cli": "^3.1.0"
},
"dependencies": {
- "@babel/polyfill": "^7.0.0",
- "node-sass": "^4.9.0",
- "react": "^16.6.0",
- "react-dom": "^16.6.0"
+ "@babel/polyfill": "7.0.0",
+ "node-sass": "4.9.0",
+ "react": "16.6.0",
+ "react-dom": "16.6.0"
}
}
From 64d820c44f43a8e6271f663e9666b8d7448a74ce Mon Sep 17 00:00:00 2001
From: Cockpit Bots
Date: Mon, 3 Dec 2018 22:13:16 +0200
Subject: [PATCH 005/942] package.json: Update react package dependency (#66)
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 5a1cde2..56b66d9 100644
--- a/package.json
+++ b/package.json
@@ -44,7 +44,7 @@
"dependencies": {
"@babel/polyfill": "7.0.0",
"node-sass": "4.9.0",
- "react": "16.6.0",
+ "react": "16.6.3",
"react-dom": "16.6.0"
}
}
From 4b3c740283d97d5de4c1113bd385dc1a3dd39d12 Mon Sep 17 00:00:00 2001
From: Cockpit Bots
Date: Thu, 6 Dec 2018 23:06:22 +0200
Subject: [PATCH 006/942] package.json: Update node-sass package dependency
Closes #68
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 56b66d9..64ccf10 100644
--- a/package.json
+++ b/package.json
@@ -43,7 +43,7 @@
},
"dependencies": {
"@babel/polyfill": "7.0.0",
- "node-sass": "4.9.0",
+ "node-sass": "4.10.0",
"react": "16.6.3",
"react-dom": "16.6.0"
}
From 02d631a18aff06b5591ce84a248858ab29fda0ba Mon Sep 17 00:00:00 2001
From: Cockpit Bots
Date: Tue, 11 Dec 2018 16:15:13 +0200
Subject: [PATCH 007/942] package.json: Update node-sass package dependency
Closes #69
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 64ccf10..10b2312 100644
--- a/package.json
+++ b/package.json
@@ -43,7 +43,7 @@
},
"dependencies": {
"@babel/polyfill": "7.0.0",
- "node-sass": "4.10.0",
+ "node-sass": "4.11.0",
"react": "16.6.3",
"react-dom": "16.6.0"
}
From e107a82f2a8cff720b1b2a822b3b68f37077da73 Mon Sep 17 00:00:00 2001
From: Cockpit Bots
Date: Fri, 14 Dec 2018 18:12:21 +0200
Subject: [PATCH 008/942] package.json: Update react-dom package dependency
Closes #70
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 10b2312..3488462 100644
--- a/package.json
+++ b/package.json
@@ -45,6 +45,6 @@
"@babel/polyfill": "7.0.0",
"node-sass": "4.11.0",
"react": "16.6.3",
- "react-dom": "16.6.0"
+ "react-dom": "16.6.3"
}
}
From f475fff8f707bbea238080c8f2f2913c5059ebb4 Mon Sep 17 00:00:00 2001
From: Cockpit Bots
Date: Sun, 23 Dec 2018 21:49:08 +0200
Subject: [PATCH 009/942] package.json: Update react-dom package dependency
(#74)
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 3488462..fdf1f31 100644
--- a/package.json
+++ b/package.json
@@ -45,6 +45,6 @@
"@babel/polyfill": "7.0.0",
"node-sass": "4.11.0",
"react": "16.6.3",
- "react-dom": "16.6.3"
+ "react-dom": "16.7.0"
}
}
From 00a9ba681401389b98ff65d52dfb22e12c450b27 Mon Sep 17 00:00:00 2001
From: Cockpit Bots
Date: Fri, 28 Dec 2018 10:09:52 +0200
Subject: [PATCH 010/942] package.json: Update react package dependency (#75)
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index fdf1f31..bcf5a60 100644
--- a/package.json
+++ b/package.json
@@ -44,7 +44,7 @@
"dependencies": {
"@babel/polyfill": "7.0.0",
"node-sass": "4.11.0",
- "react": "16.6.3",
+ "react": "16.7.0",
"react-dom": "16.7.0"
}
}
From a501ebb2bf4ea58d5d82e8a5f959fc3057f45d3f Mon Sep 17 00:00:00 2001
From: Cockpit Bots
Date: Mon, 31 Dec 2018 14:11:37 +0200
Subject: [PATCH 011/942] package.json: Update @babel/polyfill package
dependency (#76)
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index bcf5a60..3db5ca9 100644
--- a/package.json
+++ b/package.json
@@ -42,7 +42,7 @@
"webpack-cli": "^3.1.0"
},
"dependencies": {
- "@babel/polyfill": "7.0.0",
+ "@babel/polyfill": "7.2.5",
"node-sass": "4.11.0",
"react": "16.7.0",
"react-dom": "16.7.0"
From 7b67b091f1672e82e3013b579958959c4af9c4bc Mon Sep 17 00:00:00 2001
From: Kirill Glebov
Date: Thu, 17 Jan 2019 16:45:15 +0100
Subject: [PATCH 012/942] Add cockpit dependency
Closes #67
---
cockpit-starter-kit.spec.in | 2 ++
1 file changed, 2 insertions(+)
diff --git a/cockpit-starter-kit.spec.in b/cockpit-starter-kit.spec.in
index 53e8b70..4aa289b 100644
--- a/cockpit-starter-kit.spec.in
+++ b/cockpit-starter-kit.spec.in
@@ -7,6 +7,8 @@ License: LGPLv2+
Source: cockpit-starter-kit-%{version}.tar.gz
BuildArch: noarch
+Requires: cockpit-system
+
%define debug_package %{nil}
%description
From 81096b95ca3dc74ef7a21453e42588a4692a1224 Mon Sep 17 00:00:00 2001
From: bmustiata
Date: Mon, 28 Jan 2019 14:22:46 +0100
Subject: [PATCH 013/942] Support watching for changing code
Closes #93
---
Makefile | 3 +++
README.md | 10 ++++++++++
package.json | 1 +
3 files changed, 14 insertions(+)
diff --git a/Makefile b/Makefile
index 5f959c4..99381ed 100644
--- a/Makefile
+++ b/Makefile
@@ -66,6 +66,9 @@ dist/po.%.js: po/%.po $(NODE_MODULES_TEST)
$(WEBPACK_TEST): $(NODE_MODULES_TEST) $(shell find src/ -type f) package.json webpack.config.js $(patsubst %,dist/po.%.js,$(LINGUAS))
NODE_ENV=$(NODE_ENV) npm run build
+watch:
+ NODE_ENV=$(NODE_ENV) npm run watch
+
clean:
rm -rf dist/
[ ! -e cockpit-$(PACKAGE_NAME).spec.in ] || rm -f cockpit-$(PACKAGE_NAME).spec
diff --git a/README.md b/README.md
index 1f408d0..981e800 100644
--- a/README.md
+++ b/README.md
@@ -33,6 +33,16 @@ ln -s `pwd`/dist ~/.local/share/cockpit/starter-kit
After changing the code and running `make` again, reload the Cockpit page in
your browser.
+You can also use
+[watch mode](https://webpack.js.org/guides/development/#using-watch-mode) to
+automatically update the webpack on every code change with
+
+ $ npm run watch
+
+or
+
+ $ make watch
+
# Running eslint
Cockpit Starter Kit uses [ESLint](https://eslint.org/) to automatically check
diff --git a/package.json b/package.json
index 3db5ca9..193d4b1 100644
--- a/package.json
+++ b/package.json
@@ -7,6 +7,7 @@
"author": "",
"license": "LGPL-2.1",
"scripts": {
+ "watch": "webpack --watch",
"build": "webpack",
"eslint": "eslint --ext .jsx --ext .es6 src/",
"eslint:fix": "eslint --fix --ext .jsx --ext .es6 src/"
From 891480366c4e99e07c83251af9104e4475bb4c29 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Tue, 29 Jan 2019 11:54:51 +0100
Subject: [PATCH 014/942] Bump Cockpit test API to 185
No API changes.
Closes #89
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 99381ed..6019e33 100644
--- a/Makefile
+++ b/Makefile
@@ -142,7 +142,7 @@ bots:
# checkout Cockpit's test API; this has no API stability guarantee, so check out a stable tag
# when you start a new project, use the latest relese, and update it from time to time
test/common:
- git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 181
+ git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 185
git checkout --force FETCH_HEAD -- test/common
git reset test/common
From 2a2f99b6f008b6309d5bfb4344cc2fa2a364b2cc Mon Sep 17 00:00:00 2001
From: Bogdan Mustiata
Date: Sun, 27 Jan 2019 15:24:08 +0100
Subject: [PATCH 015/942] React to hostname changes
Closes #94
---
src/app.jsx | 7 +++----
test/check-application | 5 +++++
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/src/app.jsx b/src/app.jsx
index 55f1c88..a2441ef 100644
--- a/src/app.jsx
+++ b/src/app.jsx
@@ -28,10 +28,9 @@ export class Application extends React.Component {
super();
this.state = { 'hostname': _("Unknown") };
- cockpit.file('/etc/hostname').read()
- .done((content) => {
- this.setState({ 'hostname': content.trim() });
- });
+ cockpit.file('/etc/hostname').watch(content => {
+ this.setState({ 'hostname': content.trim() });
+ });
}
render() {
diff --git a/test/check-application b/test/check-application
index 40431e2..749427e 100755
--- a/test/check-application
+++ b/test/check-application
@@ -28,6 +28,11 @@ class TestApplication(testlib.MachineCase):
b.wait_present(".container-fluid p")
b.wait_text(".container-fluid p", "Running on " + hostname)
+ # change current hostname
+ m.execute("echo new-%s > /etc/hostname" % hostname)
+ # verify new hostname name
+ b.wait_text(".container-fluid p", "Running on new-" + hostname)
+
# change language to German
b.switch_to_top()
b.click("#content-user-name")
From f6430895c7fe3b5db80d349c31e234c86666b64d Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Wed, 6 Feb 2019 09:48:55 +0100
Subject: [PATCH 016/942] Move to latest eslint standard plugin
This fixes the three warnings that recently started to appear:
[ESLINT_LEGACY_OBJECT_REST_SPREAD] DeprecationWarning: The 'parserOptions.ecmaFeatures.experimentalObjectRestSpread' option is deprecated. Use 'parserOptions.ecmaVersion' instead. (found in "standard-react")
[ESLINT_LEGACY_OBJECT_REST_SPREAD] DeprecationWarning: The 'parserOptions.ecmaFeatures.experimentalObjectRestSpread' option is deprecated. Use 'parserOptions.ecmaVersion' instead. (found in "node_modules/eslint-config-standard-jsx/index.js")
[ESLINT_LEGACY_OBJECT_REST_SPREAD] DeprecationWarning: The 'parserOptions.ecmaFeatures.experimentalObjectRestSpread' option is deprecated. Use 'parserOptions.ecmaVersion' instead. (found in "standard")
Closes #99
---
.eslintrc.json | 2 +-
package.json | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/.eslintrc.json b/.eslintrc.json
index 3b7538e..e63e3a3 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -6,8 +6,8 @@
"extends": ["eslint:recommended", "standard", "standard-react"],
"parser": "babel-eslint",
"parserOptions": {
+ "ecmaVersion": "7",
"ecmaFeatures": {
- "experimentalObjectRestSpread": true,
"jsx": true
},
"sourceType": "module"
diff --git a/package.json b/package.json
index 193d4b1..9cd9b34 100644
--- a/package.json
+++ b/package.json
@@ -23,15 +23,15 @@
"copy-webpack-plugin": "^4.5.2",
"css-loader": "^0.28.11",
"eslint": "^5.4.0",
- "eslint-config-standard": "^11.0.0",
- "eslint-config-standard-react": "^6.0.0",
+ "eslint-config-standard": "^12.0.0",
+ "eslint-config-standard-react": "^7.0.2",
"eslint-loader": "^2.1.0",
"eslint-plugin-flowtype": "^2.50.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-node": "^7.0.1",
"eslint-plugin-promise": "^4.0.0",
- "eslint-plugin-react": "^6.9.0",
- "eslint-plugin-standard": "^3.1.0",
+ "eslint-plugin-react": "^7.12.4",
+ "eslint-plugin-standard": "^4.0.0",
"extract-text-webpack-plugin": "^4.0.0-beta.0",
"htmlparser": "^1.7.7",
"jed": "^1.1.1",
From 1dd8711512910f3cbf552864df8b1ea63fd4f1d6 Mon Sep 17 00:00:00 2001
From: Kyrylo Gliebov
Date: Tue, 15 Jan 2019 14:59:17 +0100
Subject: [PATCH 017/942] Add app-data-validate for metainfo.xml
Closes #82
---
Makefile | 1 +
org.cockpit-project.starter-kit.metainfo.xml | 1 +
2 files changed, 2 insertions(+)
diff --git a/Makefile b/Makefile
index 6019e33..d6048e9 100644
--- a/Makefile
+++ b/Makefile
@@ -88,6 +88,7 @@ devel-install: $(WEBPACK_TEST)
# ship a stub node_modules/ so that `make` works without re-running `npm install`
dist-gzip: NODE_ENV=production
dist-gzip: all cockpit-$(PACKAGE_NAME).spec
+ if type appstream-util >/dev/null 2>&1; then appstream-util validate-relax --nonet *.metainfo.xml; fi
mv node_modules node_modules.release
mkdir -p $(NODE_MODULES_TEST)
touch -r package.json $(NODE_MODULES_TEST)
diff --git a/org.cockpit-project.starter-kit.metainfo.xml b/org.cockpit-project.starter-kit.metainfo.xml
index ad720d8..a4d7ea2 100644
--- a/org.cockpit-project.starter-kit.metainfo.xml
+++ b/org.cockpit-project.starter-kit.metainfo.xml
@@ -1,3 +1,4 @@
+
org.cockpit-project.starter-kit
CC0-1.0
From d6e4c6be6e42e9b4fa56b70231dbe855e92565fa Mon Sep 17 00:00:00 2001
From: Cockpit Bots
Date: Fri, 8 Feb 2019 14:08:35 +0200
Subject: [PATCH 018/942] package.json: Update react-dom package dependency
Closes #100
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 9cd9b34..86bd47e 100644
--- a/package.json
+++ b/package.json
@@ -46,6 +46,6 @@
"@babel/polyfill": "7.2.5",
"node-sass": "4.11.0",
"react": "16.7.0",
- "react-dom": "16.7.0"
+ "react-dom": "16.8.1"
}
}
From 3ae93bd04e31b6cf1e26f3f3d81cfb1cb371fa7c Mon Sep 17 00:00:00 2001
From: Cockpit Bots
Date: Mon, 11 Feb 2019 15:07:49 +0200
Subject: [PATCH 019/942] package.json: Update react package dependency
Closes #101
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 86bd47e..0721264 100644
--- a/package.json
+++ b/package.json
@@ -45,7 +45,7 @@
"dependencies": {
"@babel/polyfill": "7.2.5",
"node-sass": "4.11.0",
- "react": "16.7.0",
+ "react": "16.8.1",
"react-dom": "16.8.1"
}
}
From a0d4171cc85c76623d8030b54c308ec5defa2996 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Tue, 12 Feb 2019 09:37:42 +0100
Subject: [PATCH 020/942] Validate AppStream metainfo during RPM build
This is a requirement in the Fedora packaging guidelines:
https://docs.fedoraproject.org/en-US/packaging-guidelines/AppData/#_app_data_validate_usage
Closes #102
---
cockpit-starter-kit.spec.in | 2 ++
1 file changed, 2 insertions(+)
diff --git a/cockpit-starter-kit.spec.in b/cockpit-starter-kit.spec.in
index 4aa289b..e7a2c5f 100644
--- a/cockpit-starter-kit.spec.in
+++ b/cockpit-starter-kit.spec.in
@@ -6,6 +6,7 @@ License: LGPLv2+
Source: cockpit-starter-kit-%{version}.tar.gz
BuildArch: noarch
+BuildRequires: libappstream-glib
Requires: cockpit-system
@@ -19,6 +20,7 @@ Cockpit Starter Kit Example Module
%install
%make_install
+appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/metainfo/*
%files
%{_datadir}/cockpit/*
From e9db4448c95cae2b8d081fd11c4f415c3a10bf00 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Wed, 13 Feb 2019 12:01:18 +0100
Subject: [PATCH 021/942] Bump Cockpit test API to 187
No API changes.
Closes #103
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index d6048e9..c8f828d 100644
--- a/Makefile
+++ b/Makefile
@@ -143,7 +143,7 @@ bots:
# checkout Cockpit's test API; this has no API stability guarantee, so check out a stable tag
# when you start a new project, use the latest relese, and update it from time to time
test/common:
- git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 185
+ git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 187
git checkout --force FETCH_HEAD -- test/common
git reset test/common
From 0d1ca2d5a71b6982a36a9c5bf638de1ef4ed2493 Mon Sep 17 00:00:00 2001
From: Cockpit Bots
Date: Sun, 17 Feb 2019 22:00:39 +0200
Subject: [PATCH 022/942] package.json: Update react-dom package dependency
Closes #105
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 0721264..33f100d 100644
--- a/package.json
+++ b/package.json
@@ -46,6 +46,6 @@
"@babel/polyfill": "7.2.5",
"node-sass": "4.11.0",
"react": "16.8.1",
- "react-dom": "16.8.1"
+ "react-dom": "16.8.2"
}
}
From d634cdd4625dcc22cc0d3c4cfb72bc97175a78ab Mon Sep 17 00:00:00 2001
From: Cockpit Bots
Date: Thu, 21 Feb 2019 00:30:10 +0200
Subject: [PATCH 023/942] package.json: Update react package dependency
Closes #106
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 33f100d..c71ab8d 100644
--- a/package.json
+++ b/package.json
@@ -45,7 +45,7 @@
"dependencies": {
"@babel/polyfill": "7.2.5",
"node-sass": "4.11.0",
- "react": "16.8.1",
+ "react": "16.8.2",
"react-dom": "16.8.2"
}
}
From 20cc5a28942beeb8c21445a30ea90d6d8f801e77 Mon Sep 17 00:00:00 2001
From: Cockpit Bots
Date: Sun, 24 Feb 2019 09:08:08 +0200
Subject: [PATCH 024/942] package.json: Update react package dependency
Closes #120
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index c71ab8d..d444b5e 100644
--- a/package.json
+++ b/package.json
@@ -45,7 +45,7 @@
"dependencies": {
"@babel/polyfill": "7.2.5",
"node-sass": "4.11.0",
- "react": "16.8.2",
+ "react": "16.8.3",
"react-dom": "16.8.2"
}
}
From 32f0e20ddbb6d0af304548f7e5712feb4693dfb0 Mon Sep 17 00:00:00 2001
From: Cockpit Bots
Date: Wed, 27 Feb 2019 09:10:24 +0200
Subject: [PATCH 025/942] package.json: Update react-dom package dependency
Closes #131
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index d444b5e..1f3180a 100644
--- a/package.json
+++ b/package.json
@@ -46,6 +46,6 @@
"@babel/polyfill": "7.2.5",
"node-sass": "4.11.0",
"react": "16.8.3",
- "react-dom": "16.8.2"
+ "react-dom": "16.8.3"
}
}
From afda681f4afcb70cbaa5473e2825998dd85a556c Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Mon, 4 Mar 2019 09:11:29 +0100
Subject: [PATCH 026/942] tasks: Minimize races filing issues for bots
We don't need to file or check for these issues on every iteration
through the .tasks script. These will count as "work done" and thus skip
the sleep (even though the "work" lasts only a split-second), and are
prone to creating duplicates.
Similar to https://github.com/cockpit-project/cockpit/commit/af2e934a
Closes #147
---
.tasks | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/.tasks b/.tasks
index 8da62e5..7fdc60d 100755
--- a/.tasks
+++ b/.tasks
@@ -1,7 +1,16 @@
#!/bin/sh
-# Open issues for things that need doing on a regular basis
-bots/npm-trigger
+# When run automated, randomize to minimize stampeding herd
+if [ -t 0 ]; then
+ chance=10
+else
+ chance=$(shuf -i 0-10 -n 1)
+fi
+
+if [ $chance -gt 9 ]; then
+ # Open issues for things that need doing on a regular basis
+ bots/npm-trigger
+fi
# Find those issues and propose to do them
bots/issue-scan
From 220b7d7c4f3f8b1f88e501be564b1014d47c46e1 Mon Sep 17 00:00:00 2001
From: Cockpit Bots
Date: Mon, 11 Mar 2019 08:53:00 +0200
Subject: [PATCH 027/942] package.json: Update react-dom package dependency
Closes #150
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 1f3180a..bd119b5 100644
--- a/package.json
+++ b/package.json
@@ -46,6 +46,6 @@
"@babel/polyfill": "7.2.5",
"node-sass": "4.11.0",
"react": "16.8.3",
- "react-dom": "16.8.3"
+ "react-dom": "16.8.4"
}
}
From 88f759d3e7aa67153b9d8e81f475651193e52b3f Mon Sep 17 00:00:00 2001
From: Cockpit Bots
Date: Thu, 14 Mar 2019 09:03:48 +0200
Subject: [PATCH 028/942] package.json: Update react package dependency
Closes #151
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index bd119b5..35ec58e 100644
--- a/package.json
+++ b/package.json
@@ -45,7 +45,7 @@
"dependencies": {
"@babel/polyfill": "7.2.5",
"node-sass": "4.11.0",
- "react": "16.8.3",
+ "react": "16.8.4",
"react-dom": "16.8.4"
}
}
From d4808563b534cebeabd7d2400c6b96cfed32194e Mon Sep 17 00:00:00 2001
From: Cockpit Bots
Date: Wed, 20 Mar 2019 08:40:28 +0200
Subject: [PATCH 029/942] package.json: Update @babel/polyfill package
dependency
Closes #153
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 35ec58e..0872601 100644
--- a/package.json
+++ b/package.json
@@ -43,7 +43,7 @@
"webpack-cli": "^3.1.0"
},
"dependencies": {
- "@babel/polyfill": "7.2.5",
+ "@babel/polyfill": "7.4.0",
"node-sass": "4.11.0",
"react": "16.8.4",
"react-dom": "16.8.4"
From 0f9b7e1e46b52337020282a033e21a2916391438 Mon Sep 17 00:00:00 2001
From: Cockpit Bots
Date: Sun, 24 Mar 2019 00:31:07 +0200
Subject: [PATCH 030/942] package.json: Update react-dom package dependency
Closes #154
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 0872601..1cac141 100644
--- a/package.json
+++ b/package.json
@@ -46,6 +46,6 @@
"@babel/polyfill": "7.4.0",
"node-sass": "4.11.0",
"react": "16.8.4",
- "react-dom": "16.8.4"
+ "react-dom": "16.8.5"
}
}
From dd18561c589b3e6a93503ce65578abeb01ba658b Mon Sep 17 00:00:00 2001
From: Cockpit Bots
Date: Wed, 27 Mar 2019 09:25:31 +0200
Subject: [PATCH 031/942] package.json: Update react package dependency
Closes #155
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 1cac141..79a0df6 100644
--- a/package.json
+++ b/package.json
@@ -45,7 +45,7 @@
"dependencies": {
"@babel/polyfill": "7.4.0",
"node-sass": "4.11.0",
- "react": "16.8.4",
+ "react": "16.8.5",
"react-dom": "16.8.5"
}
}
From ca20146dbebc81e161719b99bdc0e85ffe29cd73 Mon Sep 17 00:00:00 2001
From: Cockpit Bots
Date: Sat, 30 Mar 2019 20:52:08 +0200
Subject: [PATCH 032/942] package.json: Update react package dependency
Closes #156
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 79a0df6..3df816c 100644
--- a/package.json
+++ b/package.json
@@ -45,7 +45,7 @@
"dependencies": {
"@babel/polyfill": "7.4.0",
"node-sass": "4.11.0",
- "react": "16.8.5",
+ "react": "16.8.6",
"react-dom": "16.8.5"
}
}
From 026275122feef83f34ceddf3000d06aec29ad108 Mon Sep 17 00:00:00 2001
From: Cockpit Bots
Date: Tue, 2 Apr 2019 22:12:44 +0300
Subject: [PATCH 033/942] package.json: Update react-dom package dependency
Closes #157
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 3df816c..c9a5f0f 100644
--- a/package.json
+++ b/package.json
@@ -46,6 +46,6 @@
"@babel/polyfill": "7.4.0",
"node-sass": "4.11.0",
"react": "16.8.6",
- "react-dom": "16.8.5"
+ "react-dom": "16.8.6"
}
}
From d3c41370c9dd034bf839652a737b600cde20991f Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Wed, 3 Apr 2019 09:45:03 +0200
Subject: [PATCH 034/942] Bump Cockpit test API to 190
No API changes.
Closes #158
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index c8f828d..cb0eb9e 100644
--- a/Makefile
+++ b/Makefile
@@ -143,7 +143,7 @@ bots:
# checkout Cockpit's test API; this has no API stability guarantee, so check out a stable tag
# when you start a new project, use the latest relese, and update it from time to time
test/common:
- git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 187
+ git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 190
git checkout --force FETCH_HEAD -- test/common
git reset test/common
From fa7a430847f0ff8ac7a2491c79b67361311b8bee Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Wed, 3 Apr 2019 16:59:13 +0200
Subject: [PATCH 035/942] test: Remove redundant wait_present() calls (#159)
These are obsolete since
https://github.com/cockpit-project/cockpit/commit/b1722f5b5d0
Bump cockpit test API accordingly.
Closes #159
---
Makefile | 2 +-
test/check-application | 2 --
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index cb0eb9e..61d6c1e 100644
--- a/Makefile
+++ b/Makefile
@@ -143,7 +143,7 @@ bots:
# checkout Cockpit's test API; this has no API stability guarantee, so check out a stable tag
# when you start a new project, use the latest relese, and update it from time to time
test/common:
- git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 190
+ git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 191
git checkout --force FETCH_HEAD -- test/common
git reset test/common
diff --git a/test/check-application b/test/check-application
index 749427e..2ad5d68 100755
--- a/test/check-application
+++ b/test/check-application
@@ -20,12 +20,10 @@ class TestApplication(testlib.MachineCase):
self.login_and_go("/starter-kit")
# verify expected heading
- b.wait_present(".container-fluid h2")
b.wait_text(".container-fluid h2", "Starter Kit")
# verify expected host name
hostname = m.execute("hostname").strip()
- b.wait_present(".container-fluid p")
b.wait_text(".container-fluid p", "Running on " + hostname)
# change current hostname
From 018ec9d43cd807a079faacb1d1e3e34ffa605229 Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Fri, 5 Apr 2019 18:19:46 +0000
Subject: [PATCH 036/942] package.json: Update @babel/polyfill package
dependency
Closes #160
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index c9a5f0f..96b0724 100644
--- a/package.json
+++ b/package.json
@@ -43,7 +43,7 @@
"webpack-cli": "^3.1.0"
},
"dependencies": {
- "@babel/polyfill": "7.4.0",
+ "@babel/polyfill": "7.4.3",
"node-sass": "4.11.0",
"react": "16.8.6",
"react-dom": "16.8.6"
From 418a690b9eee2b346da7f61473141f060706b689 Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Sat, 27 Apr 2019 11:47:23 +0000
Subject: [PATCH 037/942] package.json: Update @babel/polyfill package
dependency
Closes #167
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 96b0724..e07df03 100644
--- a/package.json
+++ b/package.json
@@ -43,7 +43,7 @@
"webpack-cli": "^3.1.0"
},
"dependencies": {
- "@babel/polyfill": "7.4.3",
+ "@babel/polyfill": "7.4.4",
"node-sass": "4.11.0",
"react": "16.8.6",
"react-dom": "16.8.6"
From 107ed4f82e8938351e047ef3837b251fb602f22f Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Wed, 1 May 2019 08:05:13 +0000
Subject: [PATCH 038/942] package.json: Update node-sass package dependency
Closes #168
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index e07df03..74319a6 100644
--- a/package.json
+++ b/package.json
@@ -44,7 +44,7 @@
},
"dependencies": {
"@babel/polyfill": "7.4.4",
- "node-sass": "4.11.0",
+ "node-sass": "4.12.0",
"react": "16.8.6",
"react-dom": "16.8.6"
}
From 989e8c930159ae4c2e0815357bf23a67388b749b Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Wed, 5 Jun 2019 08:23:52 +0200
Subject: [PATCH 039/942] Bump Cockpit test API to 195
No API changes.
Closes #181
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 61d6c1e..f0fb253 100644
--- a/Makefile
+++ b/Makefile
@@ -143,7 +143,7 @@ bots:
# checkout Cockpit's test API; this has no API stability guarantee, so check out a stable tag
# when you start a new project, use the latest relese, and update it from time to time
test/common:
- git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 191
+ git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 195
git checkout --force FETCH_HEAD -- test/common
git reset test/common
From acc7de2d6d8574ffb3d2ae54b0f09768e0582575 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Wed, 12 Jun 2019 09:54:42 +0200
Subject: [PATCH 040/942] cockpituous: Fix srpm Release:
Use release-srpm's `-V` option [1] so that the generated srpm will get a
proper changelog and Release "1" instead of "2".
[1] https://github.com/cockpit-project/cockpituous/commit/abb2bdb5
Closes #184
---
cockpituous-release | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cockpituous-release b/cockpituous-release
index b876779..19bcb99 100644
--- a/cockpituous-release
+++ b/cockpituous-release
@@ -12,7 +12,7 @@ RELEASE_SPEC="cockpit-starter-kit.spec"
RELEASE_SRPM="_release/srpm"
job release-source
-job release-srpm
+job release-srpm -V
# Once you have a Fedora package and add the https://pagure.io/user/cockpit
# user to your project's maintainers, you can also upload to Fedora automatically:
From d900a7231d95fb18a1badeab668870c2a0da1018 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Thu, 11 Jul 2019 11:58:18 +0200
Subject: [PATCH 041/942] tasks: Drop issue-scan
This is now done by webhooks and AMQP.
Closes #195
---
.tasks | 3 ---
1 file changed, 3 deletions(-)
diff --git a/.tasks b/.tasks
index 7fdc60d..2026460 100755
--- a/.tasks
+++ b/.tasks
@@ -11,6 +11,3 @@ if [ $chance -gt 9 ]; then
# Open issues for things that need doing on a regular basis
bots/npm-trigger
fi
-
-# Find those issues and propose to do them
-bots/issue-scan
From 077eba3ede2cd88ba447dd65947bc6392b2d7369 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Thu, 11 Jul 2019 13:17:13 +0200
Subject: [PATCH 042/942] Update to current eslint
This has a new rule `quote-props`, adjust the code accordingly:
29:24 error Unnecessarily quoted property 'hostname' found quote-props
32:29 error Unnecessarily quoted property 'hostname' found quote-props
---
package.json | 16 ++++++++--------
src/app.jsx | 4 ++--
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/package.json b/package.json
index 74319a6..3597de6 100644
--- a/package.json
+++ b/package.json
@@ -22,15 +22,15 @@
"compression-webpack-plugin": "^1.1.11",
"copy-webpack-plugin": "^4.5.2",
"css-loader": "^0.28.11",
- "eslint": "^5.4.0",
- "eslint-config-standard": "^12.0.0",
+ "eslint": "^6.0.1",
+ "eslint-config-standard": "^13.0.0",
"eslint-config-standard-react": "^7.0.2",
- "eslint-loader": "^2.1.0",
- "eslint-plugin-flowtype": "^2.50.0",
- "eslint-plugin-import": "^2.14.0",
- "eslint-plugin-node": "^7.0.1",
- "eslint-plugin-promise": "^4.0.0",
- "eslint-plugin-react": "^7.12.4",
+ "eslint-loader": "^2.2.1",
+ "eslint-plugin-flowtype": "^3.11.1",
+ "eslint-plugin-import": "^2.18.0",
+ "eslint-plugin-node": "^9.1.0",
+ "eslint-plugin-promise": "^4.2.1",
+ "eslint-plugin-react": "^7.14.2",
"eslint-plugin-standard": "^4.0.0",
"extract-text-webpack-plugin": "^4.0.0-beta.0",
"htmlparser": "^1.7.7",
diff --git a/src/app.jsx b/src/app.jsx
index a2441ef..1f671a9 100644
--- a/src/app.jsx
+++ b/src/app.jsx
@@ -26,10 +26,10 @@ const _ = cockpit.gettext;
export class Application extends React.Component {
constructor() {
super();
- this.state = { 'hostname': _("Unknown") };
+ this.state = { hostname: _("Unknown") };
cockpit.file('/etc/hostname').watch(content => {
- this.setState({ 'hostname': content.trim() });
+ this.setState({ hostname: content.trim() });
});
}
From eea86c986f7e03863f8b0e3c41b46bef576c3505 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Thu, 11 Jul 2019 13:19:53 +0200
Subject: [PATCH 043/942] Explicitly specify browser compatibility in babel
We do this in cockpit and cockpit-ostree.
---
.babelrc | 4 ----
webpack.config.js | 24 +++++++++++++++++++++---
2 files changed, 21 insertions(+), 7 deletions(-)
delete mode 100644 .babelrc
diff --git a/.babelrc b/.babelrc
deleted file mode 100644
index d0ef093..0000000
--- a/.babelrc
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "presets": ["@babel/env",
- "@babel/preset-react"]
-}
diff --git a/webpack.config.js b/webpack.config.js
index fce4863..ee6a182 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -95,6 +95,24 @@ if (production) {
}));
}
+var babel_loader = {
+ loader: "babel-loader",
+ options: {
+ presets: [
+ ["@babel/env", {
+ "targets": {
+ "chrome": "57",
+ "firefox": "52",
+ "safari": "10.3",
+ "edge": "16",
+ "opera": "44"
+ }
+ }],
+ "@babel/preset-react"
+ ]
+ }
+}
+
module.exports = {
mode: production ? 'production' : 'development',
entry: info.entries,
@@ -117,17 +135,17 @@ module.exports = {
},
{
exclude: /node_modules/,
- loader: 'babel-loader',
+ use: babel_loader,
test: /\.js$/
},
{
exclude: /node_modules/,
- loader: 'babel-loader',
+ use: babel_loader,
test: /\.jsx$/
},
{
exclude: /node_modules/,
- loader: 'babel-loader',
+ use: babel_loader,
test: /\.es6$/
},
{
From 1fc1923021965ecb91374d857c10e8c832a9574d Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Thu, 11 Jul 2019 13:23:22 +0200
Subject: [PATCH 044/942] Rename *.es6 to *.js
*.es6 isn't standard naming, that was just an old cockpit-ism. All files
are treated as ES6.
---
Makefile | 2 +-
README.md | 2 +-
package.json | 4 ++--
src/{index.es6 => index.js} | 0
webpack.config.js | 22 +++-------------------
5 files changed, 7 insertions(+), 23 deletions(-)
rename src/{index.es6 => index.js} (100%)
diff --git a/Makefile b/Makefile
index f0fb253..f28d50b 100644
--- a/Makefile
+++ b/Makefile
@@ -21,7 +21,7 @@ LINGUAS=$(basename $(notdir $(wildcard po/*.po)))
po/POTFILES.js.in:
mkdir -p $(dir $@)
- find src/ -name '*.js' -o -name '*.jsx' -o -name '*.es6' > $@
+ find src/ -name '*.js' -o -name '*.jsx' > $@
po/$(PACKAGE_NAME).js.pot: po/POTFILES.js.in
xgettext --default-domain=cockpit --output=$@ --language=C --keyword= \
diff --git a/README.md b/README.md
index 981e800..4700153 100644
--- a/README.md
+++ b/README.md
@@ -46,7 +46,7 @@ or
# Running eslint
Cockpit Starter Kit uses [ESLint](https://eslint.org/) to automatically check
-JavaScript code style in `.jsx` and `.es6` files.
+JavaScript code style in `.js` and `.jsx` files.
The linter is executed within every build as a webpack preloader.
diff --git a/package.json b/package.json
index 3597de6..85701f1 100644
--- a/package.json
+++ b/package.json
@@ -9,8 +9,8 @@
"scripts": {
"watch": "webpack --watch",
"build": "webpack",
- "eslint": "eslint --ext .jsx --ext .es6 src/",
- "eslint:fix": "eslint --fix --ext .jsx --ext .es6 src/"
+ "eslint": "eslint --ext .js --ext .jsx src/",
+ "eslint:fix": "eslint --fix --ext .js --ext .jsx src/"
},
"devDependencies": {
"@babel/core": "^7.0.0",
diff --git a/src/index.es6 b/src/index.js
similarity index 100%
rename from src/index.es6
rename to src/index.js
diff --git a/webpack.config.js b/webpack.config.js
index ee6a182..eb78ca1 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -22,7 +22,7 @@ var production = process.env.NODE_ENV === 'production';
var info = {
entries: {
"index": [
- "./index.es6"
+ "./index.js"
]
},
files: [
@@ -125,28 +125,12 @@ module.exports = {
enforce: 'pre',
exclude: /node_modules/,
loader: 'eslint-loader',
- test: /\.jsx$/
- },
- {
- enforce: 'pre',
- exclude: /node_modules/,
- loader: 'eslint-loader',
- test: /\.es6$/
+ test: /\.(js|jsx)$/
},
{
exclude: /node_modules/,
use: babel_loader,
- test: /\.js$/
- },
- {
- exclude: /node_modules/,
- use: babel_loader,
- test: /\.jsx$/
- },
- {
- exclude: /node_modules/,
- use: babel_loader,
- test: /\.es6$/
+ test: /\.(js|jsx)$/
},
{
exclude: /node_modules/,
From 8fab928dcb311dc02729d7b1fdf1f24e61fdfc95 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Thu, 11 Jul 2019 13:39:32 +0200
Subject: [PATCH 045/942] Update babel to 7.5, and actually enable polyfills
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@babel/polyfill is deprecated in ≥ 7.4 [1], and we never actually used
it as we forgot to import it [2]. Move to core-js/stable.
[1] https://babeljs.io/blog/2019/03/19/7.4.0#migration-from-core-js-2
[2] https://babeljs.io/docs/en/babel-polyfill#usage-in-node-browserify-webpack
---
package.json | 6 +++---
src/index.js | 2 ++
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/package.json b/package.json
index 85701f1..2e99f7d 100644
--- a/package.json
+++ b/package.json
@@ -13,8 +13,8 @@
"eslint:fix": "eslint --fix --ext .js --ext .jsx src/"
},
"devDependencies": {
- "@babel/core": "^7.0.0",
- "@babel/preset-env": "^7.0.0",
+ "@babel/core": "^7.5.4",
+ "@babel/preset-env": "^7.5.4",
"@babel/preset-react": "^7.0.0",
"babel-eslint": "^9.0.0",
"babel-loader": "^8.0.0",
@@ -43,7 +43,7 @@
"webpack-cli": "^3.1.0"
},
"dependencies": {
- "@babel/polyfill": "7.4.4",
+ "core-js": "^3.1.4",
"node-sass": "4.12.0",
"react": "16.8.6",
"react-dom": "16.8.6"
diff --git a/src/index.js b/src/index.js
index cb3ca05..0a0e535 100644
--- a/src/index.js
+++ b/src/index.js
@@ -17,6 +17,8 @@
* along with Cockpit; If not, see .
*/
+import "core-js/stable";
+
import React from 'react';
import ReactDOM from 'react-dom';
import { Application } from './app.jsx';
From 0cf6704708b73f807e24497fb311564f110f6a4c Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Thu, 11 Jul 2019 13:44:26 +0200
Subject: [PATCH 046/942] Bump css-loader to current version
This also updates to a newer js-yaml, which addresses the current two
`npm audit` issues:
- https://npmjs.com/advisories/788
- https://npmjs.com/advisories/813
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 2e99f7d..2b927da 100644
--- a/package.json
+++ b/package.json
@@ -21,7 +21,7 @@
"chrome-remote-interface": "^0.26.1",
"compression-webpack-plugin": "^1.1.11",
"copy-webpack-plugin": "^4.5.2",
- "css-loader": "^0.28.11",
+ "css-loader": "^3.0.0",
"eslint": "^6.0.1",
"eslint-config-standard": "^13.0.0",
"eslint-config-standard-react": "^7.0.2",
From 35011e4709d71df9e077f622085c18c2f5d7a240 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Thu, 11 Jul 2019 13:46:18 +0200
Subject: [PATCH 047/942] Drop source map
They are large and just for debugging. If they are needed, they should
move into a separate -debugsource package, but this seems a bit overkill
as a default.
Closes #197
---
cockpit-starter-kit.spec.in | 3 +++
1 file changed, 3 insertions(+)
diff --git a/cockpit-starter-kit.spec.in b/cockpit-starter-kit.spec.in
index e7a2c5f..48f5b17 100644
--- a/cockpit-starter-kit.spec.in
+++ b/cockpit-starter-kit.spec.in
@@ -22,6 +22,9 @@ Cockpit Starter Kit Example Module
%make_install
appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/metainfo/*
+# drop source maps, they are large and just for debugging
+find %{buildroot}%{_datadir}/cockpit/ -name '*.map' | xargs rm --verbose
+
%files
%{_datadir}/cockpit/*
%{_datadir}/metainfo/*
From 97ab5e35b6da432ed70bc2b93b586363d05d4c5f Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Wed, 31 Jul 2019 14:09:50 +0200
Subject: [PATCH 048/942] Fix AppStream ID
Cockpit renamed its ID to "org.cockpit_project.cockpit" to conform to
the AppStream spec [1]. Follow suit and also fix our own IDs to not
contain hyphens.
[1] https://github.com/cockpit-project/cockpit/commit/4a9ffe669c
Closes #204
---
org.cockpit-project.starter-kit.metainfo.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/org.cockpit-project.starter-kit.metainfo.xml b/org.cockpit-project.starter-kit.metainfo.xml
index a4d7ea2..3545eca 100644
--- a/org.cockpit-project.starter-kit.metainfo.xml
+++ b/org.cockpit-project.starter-kit.metainfo.xml
@@ -1,6 +1,6 @@
- org.cockpit-project.starter-kit
+ org.cockpit_project.starter_kit
CC0-1.0
Starter Kit
@@ -11,6 +11,6 @@
Scaffolding for a cockpit module.
- cockpit.desktop
+ org.cockpit_project.cockpit
cockpit-starter-kit
From 044b8da55af5ed3cd4c5db92b71f350b41465cee Mon Sep 17 00:00:00 2001
From: Sanne Raymaekers
Date: Wed, 21 Aug 2019 17:50:44 +0200
Subject: [PATCH 049/942] eslintrc: Set "root" to true
Eslint shimmies up directories looking for more eslintrcs. As
make-checkout now clones projects in a subdirectory of cockpit, this can
result in some strange interactions.
https://eslint.org/docs/user-guide/configuring
Closes #212
---
.eslintrc.json | 1 +
1 file changed, 1 insertion(+)
diff --git a/.eslintrc.json b/.eslintrc.json
index e63e3a3..b1fe5d2 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -1,4 +1,5 @@
{
+ "root": true,
"env": {
"browser": true,
"es6": true
From d0a2ebcf0e477851860bad8b9c8022669a158670 Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Wed, 28 Aug 2019 14:52:21 +0000
Subject: [PATCH 050/942] package.json: Update react package dependency
Closes #216
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 2b927da..dec6969 100644
--- a/package.json
+++ b/package.json
@@ -45,7 +45,7 @@
"dependencies": {
"core-js": "^3.1.4",
"node-sass": "4.12.0",
- "react": "16.8.6",
+ "react": "16.9.0",
"react-dom": "16.8.6"
}
}
From e557e1d45a3496100652123b667d9079ee04e796 Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Sat, 31 Aug 2019 17:26:28 +0000
Subject: [PATCH 051/942] package.json: Update react-dom package dependency
Closes #217
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index dec6969..e1110ed 100644
--- a/package.json
+++ b/package.json
@@ -46,6 +46,6 @@
"core-js": "^3.1.4",
"node-sass": "4.12.0",
"react": "16.9.0",
- "react-dom": "16.8.6"
+ "react-dom": "16.9.0"
}
}
From 171a30a691f1d3d8833e8fc7744d228afcbbbf44 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Wed, 11 Sep 2019 08:33:51 +0200
Subject: [PATCH 052/942] Bump eslint to latest version
No source code changes necessary.
---
package.json | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/package.json b/package.json
index e1110ed..07f283a 100644
--- a/package.json
+++ b/package.json
@@ -16,22 +16,22 @@
"@babel/core": "^7.5.4",
"@babel/preset-env": "^7.5.4",
"@babel/preset-react": "^7.0.0",
- "babel-eslint": "^9.0.0",
+ "babel-eslint": "^10.0.3",
"babel-loader": "^8.0.0",
"chrome-remote-interface": "^0.26.1",
"compression-webpack-plugin": "^1.1.11",
"copy-webpack-plugin": "^4.5.2",
"css-loader": "^3.0.0",
- "eslint": "^6.0.1",
- "eslint-config-standard": "^13.0.0",
- "eslint-config-standard-react": "^7.0.2",
- "eslint-loader": "^2.2.1",
- "eslint-plugin-flowtype": "^3.11.1",
- "eslint-plugin-import": "^2.18.0",
- "eslint-plugin-node": "^9.1.0",
+ "eslint": "^6.3.0",
+ "eslint-config-standard": "^14.1.0",
+ "eslint-config-standard-react": "^9.2.0",
+ "eslint-loader": "^3.0.0",
+ "eslint-plugin-flowtype": "^4.3.0",
+ "eslint-plugin-import": "^2.18.2",
+ "eslint-plugin-node": "^10.0.0",
"eslint-plugin-promise": "^4.2.1",
- "eslint-plugin-react": "^7.14.2",
- "eslint-plugin-standard": "^4.0.0",
+ "eslint-plugin-react": "^7.14.3",
+ "eslint-plugin-standard": "^4.0.1",
"extract-text-webpack-plugin": "^4.0.0-beta.0",
"htmlparser": "^1.7.7",
"jed": "^1.1.1",
From 1dbe7337f425838b501e567adef44e283f149b24 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Wed, 11 Sep 2019 08:34:29 +0200
Subject: [PATCH 053/942] Fix core-js npm dependency
We want pinned-down versions for runtime dependencies, and update them
with our bots.
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 07f283a..66dccf6 100644
--- a/package.json
+++ b/package.json
@@ -43,7 +43,7 @@
"webpack-cli": "^3.1.0"
},
"dependencies": {
- "core-js": "^3.1.4",
+ "core-js": "3.2.1",
"node-sass": "4.12.0",
"react": "16.9.0",
"react-dom": "16.9.0"
From e7fc85c1b0ae6b62aade0ea5cfc588f3ee54d313 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Wed, 11 Sep 2019 08:39:03 +0200
Subject: [PATCH 054/942] Bump chrome-remote-interface npm dependency
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 66dccf6..f6cb31f 100644
--- a/package.json
+++ b/package.json
@@ -18,7 +18,7 @@
"@babel/preset-react": "^7.0.0",
"babel-eslint": "^10.0.3",
"babel-loader": "^8.0.0",
- "chrome-remote-interface": "^0.26.1",
+ "chrome-remote-interface": "^0.28.0",
"compression-webpack-plugin": "^1.1.11",
"copy-webpack-plugin": "^4.5.2",
"css-loader": "^3.0.0",
From 25b970ec6b54e2433ad09eacc3ff3067b25cebcf Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Wed, 11 Sep 2019 08:39:23 +0200
Subject: [PATCH 055/942] Bump cockpit test API to 202
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index f28d50b..a73b823 100644
--- a/Makefile
+++ b/Makefile
@@ -143,7 +143,7 @@ bots:
# checkout Cockpit's test API; this has no API stability guarantee, so check out a stable tag
# when you start a new project, use the latest relese, and update it from time to time
test/common:
- git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 195
+ git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 202
git checkout --force FETCH_HEAD -- test/common
git reset test/common
From b4cb5fe5c91ffdac9e8b5c7c6633a21b0ca7b66d Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Wed, 11 Sep 2019 08:48:53 +0200
Subject: [PATCH 056/942] Bump po2json npm dependency
This gets rid of a deprecated transitive dependency:
deprecated nomnom@1.8.1: Package no longer supported. Contact support@npmjs.com for more info.
Closes #221
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index f6cb31f..66310b9 100644
--- a/package.json
+++ b/package.json
@@ -35,7 +35,7 @@
"extract-text-webpack-plugin": "^4.0.0-beta.0",
"htmlparser": "^1.7.7",
"jed": "^1.1.1",
- "po2json": "^0.4.5",
+ "po2json": "^1.0.0-alpha",
"sass-loader": "^7.0.3",
"sizzle": "^2.3.3",
"stdio": "^0.2.7",
From bfc4039b3e1171b596889f48473f9a0492c2f85f Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Thu, 12 Sep 2019 10:47:58 +0200
Subject: [PATCH 057/942] Use and ship package-lock.json
npm install has been generating package-lock.json [1] for long enough
for us to start relying on it.
Replace the unreliable and hacky `$NODE_MODULES_TEST` file with just
comparing package.json against package-lock.json to decide when to run
npm install. This will finally avoid unnecessary `npm install` runs, but
start to run these when git switching branches that have a different
package.json.
Ship package-lock.json in release tarballs, so that node_modules/ can be
reconstructed exactly as it was when making the release.
[1] https://docs.npmjs.com/files/package-lock.json
Closes #222
---
Makefile | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/Makefile b/Makefile
index a73b823..dbc77c0 100644
--- a/Makefile
+++ b/Makefile
@@ -6,8 +6,8 @@ TEST_OS = centos-7
endif
export TEST_OS
VM_IMAGE=$(CURDIR)/test/images/$(TEST_OS)
-# one example directory from `npm install` to check if that already ran
-NODE_MODULES_TEST=node_modules/po2json
+# stamp file to check if/when npm install ran
+NODE_MODULES_TEST=package-lock.json
# one example file in dist/ from webpack to check if that already ran
WEBPACK_TEST=dist/index.html
@@ -85,18 +85,18 @@ devel-install: $(WEBPACK_TEST)
ln -s `pwd`/dist ~/.local/share/cockpit/$(PACKAGE_NAME)
# when building a distribution tarball, call webpack with a 'production' environment
-# ship a stub node_modules/ so that `make` works without re-running `npm install`
+# we don't ship node_modules for license and compactness reasons; we ship a
+# pre-built dist/ (so it's not necessary) and ship packge-lock.json (so that
+# node_modules/ can be reconstructed if necessary)
dist-gzip: NODE_ENV=production
dist-gzip: all cockpit-$(PACKAGE_NAME).spec
if type appstream-util >/dev/null 2>&1; then appstream-util validate-relax --nonet *.metainfo.xml; fi
mv node_modules node_modules.release
- mkdir -p $(NODE_MODULES_TEST)
touch -r package.json $(NODE_MODULES_TEST)
touch dist/*
tar czf cockpit-$(PACKAGE_NAME)-$(VERSION).tar.gz --transform 's,^,cockpit-$(PACKAGE_NAME)/,' \
--exclude cockpit-$(PACKAGE_NAME).spec.in \
- $$(git ls-files) cockpit-$(PACKAGE_NAME).spec dist/ node_modules
- rm -rf node_modules
+ $$(git ls-files) package-lock.json cockpit-$(PACKAGE_NAME).spec dist/
mv node_modules.release node_modules
srpm: dist-gzip cockpit-$(PACKAGE_NAME).spec
From 0afad278ebf89c44369bf495ae8105280722e6ea Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Thu, 12 Sep 2019 11:08:07 +0200
Subject: [PATCH 058/942] Fix updating of node_modules/
`npm install` does not update/touch an already existing
package-lock.json. Thus after
make
touch package.json
make
a subsequent `make` would still run `npm install`. To fix this, remove
package-lock.json before `npm install`, so that (1) package-lock.json
always gets touched and thus the make rule actually works, and (2)
during development we always get up to date packages (we only really
want the "locking" behaviour for building from release tarballs).
Also run `npm prune` so that switching between git trees with
added/removed modules works correctly.
Closes #223
---
Makefile | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Makefile b/Makefile
index dbc77c0..08059db 100644
--- a/Makefile
+++ b/Makefile
@@ -148,6 +148,9 @@ test/common:
git reset test/common
$(NODE_MODULES_TEST): package.json
+ # if it exists already, npm install won't update it; force that so that we always get up-to-date packages
+ rm -f package-lock.json
npm install
+ npm prune
.PHONY: all clean install devel-install dist-gzip srpm rpm check vm update-po
From 0d636daa4790b1e79d48a132c45b07ff09b83e4e Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Thu, 12 Sep 2019 11:31:42 +0200
Subject: [PATCH 059/942] Fix building under NODE_ENV=production
This is meant to only control webpack. But `npm install` skips
installing `devDependencies` under `NODE_ENV=production`, which breaks
the package build. So always unset it for npm.
This fixes `NODE_ENV=production make` in a clean tree.
---
Makefile | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 08059db..ecc861f 100644
--- a/Makefile
+++ b/Makefile
@@ -150,7 +150,8 @@ test/common:
$(NODE_MODULES_TEST): package.json
# if it exists already, npm install won't update it; force that so that we always get up-to-date packages
rm -f package-lock.json
- npm install
- npm prune
+ # unset NODE_ENV, skips devDependencies otherwise
+ env -u NODE_ENV npm install
+ env -u NODE_ENV npm prune
.PHONY: all clean install devel-install dist-gzip srpm rpm check vm update-po
From 95b2aff0b87fa53472dde90d5e7d20e1af1e32e3 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Mon, 23 Sep 2019 17:28:30 +0200
Subject: [PATCH 060/942] Makefile: Update bots target for moved GitHub project
Cockpit bots are in their own project now.
Make the target phony so that `make bots` updates an existing checkout.
Closes #228
---
Makefile | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/Makefile b/Makefile
index ecc861f..1f6afca 100644
--- a/Makefile
+++ b/Makefile
@@ -133,12 +133,14 @@ vm: $(VM_IMAGE)
check: $(NODE_MODULES_TEST) $(VM_IMAGE) test/common
TEST_AUDIT_NO_SELINUX=1 test/check-application
-# checkout Cockpit's bots/ directory for standard test VM images and API to launch them
-# must be from cockpit's master, as only that has current and existing images; but testvm.py API is stable
+# checkout Cockpit's bots for standard test VM images and API to launch them
+# must be from master, as only that has current and existing images; but testvm.py API is stable
bots:
- git fetch --depth=1 https://github.com/cockpit-project/cockpit.git
- git checkout --force FETCH_HEAD -- bots/
- git reset bots
+ if [ ! -d bots ]; then \
+ git clone --depth=1 https://github.com/cockpit-project/bots.git; \
+ else \
+ cd bots && git fetch && git reset --hard origin/master; \
+ fi
# checkout Cockpit's test API; this has no API stability guarantee, so check out a stable tag
# when you start a new project, use the latest relese, and update it from time to time
@@ -154,4 +156,4 @@ $(NODE_MODULES_TEST): package.json
env -u NODE_ENV npm install
env -u NODE_ENV npm prune
-.PHONY: all clean install devel-install dist-gzip srpm rpm check vm update-po
+.PHONY: all bots clean install devel-install dist-gzip srpm rpm check vm update-po
From b57fe40296c9750ebcd6918a8e38973186e654ab Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Sat, 28 Sep 2019 13:18:20 +0000
Subject: [PATCH 061/942] package.json: Update react package dependency
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 66310b9..fe80ac2 100644
--- a/package.json
+++ b/package.json
@@ -45,7 +45,7 @@
"dependencies": {
"core-js": "3.2.1",
"node-sass": "4.12.0",
- "react": "16.9.0",
+ "react": "16.10.0",
"react-dom": "16.9.0"
}
}
From 24311984e88867a26f6522974be31934e40ba971 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Fri, 27 Sep 2019 15:28:30 +0200
Subject: [PATCH 062/942] Makefile: Fix image-customize call for multiple rpms
Ensure that we only install the current rpm into the VM. If there are
older ones in the build tree, image-customize otherwise fails.
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 1f6afca..061ce0c 100644
--- a/Makefile
+++ b/Makefile
@@ -123,7 +123,7 @@ rpm: dist-gzip cockpit-$(PACKAGE_NAME).spec
# build a VM with locally built rpm installed
$(VM_IMAGE): rpm bots
rm -f $(VM_IMAGE) $(VM_IMAGE).qcow2
- bots/image-customize -v -i cockpit -i `pwd`/cockpit-$(PACKAGE_NAME)-*.noarch.rpm -s $(CURDIR)/test/vm.install $(TEST_OS)
+ bots/image-customize -v -i cockpit -i `pwd`/cockpit-$(PACKAGE_NAME)-*$(VERSION)*.noarch.rpm -s $(CURDIR)/test/vm.install $(TEST_OS)
# convenience target for the above
vm: $(VM_IMAGE)
From d43845c1a352768c1a08100573755b274fb1be92 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Tue, 1 Oct 2019 23:00:07 +0200
Subject: [PATCH 063/942] Makefile: Don't clobber an existing bots checkout
Commit 95b2aff0 was a thinko -- for our CI we *don't* want our test to
clobber a pre-existing bots/ checkout, as we often use this to run tests
against an updated image or to validate a changes to the bots project.
On developer machines, bots may also be a symlink to an actual bots
directory in development, so don't clobber that.
Closes #232
---
Makefile | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/Makefile b/Makefile
index 061ce0c..31f7c5d 100644
--- a/Makefile
+++ b/Makefile
@@ -136,11 +136,7 @@ check: $(NODE_MODULES_TEST) $(VM_IMAGE) test/common
# checkout Cockpit's bots for standard test VM images and API to launch them
# must be from master, as only that has current and existing images; but testvm.py API is stable
bots:
- if [ ! -d bots ]; then \
- git clone --depth=1 https://github.com/cockpit-project/bots.git; \
- else \
- cd bots && git fetch && git reset --hard origin/master; \
- fi
+ [ -d bots ] || git clone --depth=1 https://github.com/cockpit-project/bots.git
# checkout Cockpit's test API; this has no API stability guarantee, so check out a stable tag
# when you start a new project, use the latest relese, and update it from time to time
From 0a0fc145609474884d7ab9f8df590bfa95328aeb Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Wed, 2 Oct 2019 09:09:44 +0000
Subject: [PATCH 064/942] package.json: Update react-dom package dependency
Closes #234
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index fe80ac2..9f7d879 100644
--- a/package.json
+++ b/package.json
@@ -46,6 +46,6 @@
"core-js": "3.2.1",
"node-sass": "4.12.0",
"react": "16.10.0",
- "react-dom": "16.9.0"
+ "react-dom": "16.10.1"
}
}
From bd0fea40f2dd44b49e44a891afd6ebb5a6959e57 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Wed, 2 Oct 2019 09:11:55 +0200
Subject: [PATCH 065/942] Support CI testing against a bots project PR
* If `$COCKPIT_BOTS_REF` is set, check out that bots version instead of
master.
* Use git cache in $XDG_CACHE_HOME if available. Our CI uses that to
save downloads, and it does not get in the way for local developers.
* Stop making "bots" a phony target, and drop the now unnecessary
`[ -d bots ]` check.
Closes #233
---
Makefile | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 31f7c5d..9c108b9 100644
--- a/Makefile
+++ b/Makefile
@@ -135,8 +135,11 @@ check: $(NODE_MODULES_TEST) $(VM_IMAGE) test/common
# checkout Cockpit's bots for standard test VM images and API to launch them
# must be from master, as only that has current and existing images; but testvm.py API is stable
+# support CI testing against a bots change
bots:
- [ -d bots ] || git clone --depth=1 https://github.com/cockpit-project/bots.git
+ git clone --quiet --reference-if-able $${XDG_CACHE_HOME:-$$HOME/.cache}/cockpit-project/bots https://github.com/cockpit-project/bots.git
+ if [ -n "$$COCKPIT_BOTS_REF" ]; then git -C bots fetch --quiet --depth=1 origin "$$COCKPIT_BOTS_REF"; git -C bots checkout --quiet FETCH_HEAD; fi
+ @echo "checked out bots/ ref $$(git -C bots rev-parse HEAD)"
# checkout Cockpit's test API; this has no API stability guarantee, so check out a stable tag
# when you start a new project, use the latest relese, and update it from time to time
@@ -152,4 +155,4 @@ $(NODE_MODULES_TEST): package.json
env -u NODE_ENV npm install
env -u NODE_ENV npm prune
-.PHONY: all bots clean install devel-install dist-gzip srpm rpm check vm update-po
+.PHONY: all clean install devel-install dist-gzip srpm rpm check vm update-po
From e4420fd02ef6f9f5c16dd455e36758cf63d7e11d Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Sat, 5 Oct 2019 10:56:33 +0000
Subject: [PATCH 066/942] package.json: Update react-dom package dependency
Closes #235
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 9f7d879..bd32cae 100644
--- a/package.json
+++ b/package.json
@@ -46,6 +46,6 @@
"core-js": "3.2.1",
"node-sass": "4.12.0",
"react": "16.10.0",
- "react-dom": "16.10.1"
+ "react-dom": "16.10.2"
}
}
From b9925f29c5a451cbdbf406f2619e26f4f02a218d Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Wed, 9 Oct 2019 19:44:42 +0000
Subject: [PATCH 067/942] package.json: Update react package dependency
Closes #236
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index bd32cae..6f7131b 100644
--- a/package.json
+++ b/package.json
@@ -45,7 +45,7 @@
"dependencies": {
"core-js": "3.2.1",
"node-sass": "4.12.0",
- "react": "16.10.0",
+ "react": "16.10.2",
"react-dom": "16.10.2"
}
}
From 31d628cffcb169eeb483afa541a38a2dd013f0d9 Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Wed, 16 Oct 2019 08:10:49 +0000
Subject: [PATCH 068/942] package.json: Update core-js package dependency
Closes #238
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 6f7131b..cc9e88a 100644
--- a/package.json
+++ b/package.json
@@ -43,7 +43,7 @@
"webpack-cli": "^3.1.0"
},
"dependencies": {
- "core-js": "3.2.1",
+ "core-js": "3.3.2",
"node-sass": "4.12.0",
"react": "16.10.2",
"react-dom": "16.10.2"
From 024b1a2b165857dddef328605c6426e6c43e1935 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Wed, 16 Oct 2019 11:00:17 +0200
Subject: [PATCH 069/942] Add eslint rules for React hooks
These make components with simple state (only a few variables) easier to
read and maintain. See https://reactjs.org/docs/hooks-intro.html for
details. Hook are available since React 16.8, and we already depend on 16.10.
We can't use hooks in our actual code, as our only `Application`
component needs a constructor. But this enables the ESLint plugin to
guide developers to the right path if they use hooks.
Closes #239
---
.eslintrc.json | 5 ++++-
package.json | 1 +
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/.eslintrc.json b/.eslintrc.json
index b1fe5d2..e660dc9 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -13,7 +13,7 @@
},
"sourceType": "module"
},
- "plugins": ["flowtype", "react"],
+ "plugins": ["flowtype", "react", "react-hooks"],
"rules": {
"indent": ["error", 4,
{
@@ -28,6 +28,9 @@
"react/jsx-indent": ["error", 4],
"semi": ["error", "always", { "omitLastInOneLineBlock": true }],
+ "react-hooks/rules-of-hooks": "error",
+ "react-hooks/exhaustive-deps": "error",
+
"camelcase": "off",
"comma-dangle": "off",
"curly": "off",
diff --git a/package.json b/package.json
index cc9e88a..8b00bcd 100644
--- a/package.json
+++ b/package.json
@@ -31,6 +31,7 @@
"eslint-plugin-node": "^10.0.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-react": "^7.14.3",
+ "eslint-plugin-react-hooks": "^2.1.2",
"eslint-plugin-standard": "^4.0.1",
"extract-text-webpack-plugin": "^4.0.0-beta.0",
"htmlparser": "^1.7.7",
From bab6d4e8dd9e81babcbbdf42c53f8c2f723e95c7 Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Tue, 22 Oct 2019 08:26:41 +0000
Subject: [PATCH 070/942] package.json: Update core-js package dependency
Closes #241
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 8b00bcd..55a2741 100644
--- a/package.json
+++ b/package.json
@@ -44,7 +44,7 @@
"webpack-cli": "^3.1.0"
},
"dependencies": {
- "core-js": "3.3.2",
+ "core-js": "3.3.3",
"node-sass": "4.12.0",
"react": "16.10.2",
"react-dom": "16.10.2"
From 4900daba390ff2321da46f3830fd2ff2781263f0 Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Sun, 27 Oct 2019 09:54:07 +0000
Subject: [PATCH 071/942] package.json: Update react-dom package dependency
Closes #242
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 55a2741..4c233fe 100644
--- a/package.json
+++ b/package.json
@@ -47,6 +47,6 @@
"core-js": "3.3.3",
"node-sass": "4.12.0",
"react": "16.10.2",
- "react-dom": "16.10.2"
+ "react-dom": "16.11.0"
}
}
From bded1d1d5f3f22bc8064684e8ecbbd2acb43b6e7 Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Wed, 30 Oct 2019 17:54:57 +0000
Subject: [PATCH 072/942] package.json: Update node-sass package dependency
Closes #243
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 4c233fe..94f0820 100644
--- a/package.json
+++ b/package.json
@@ -45,7 +45,7 @@
},
"dependencies": {
"core-js": "3.3.3",
- "node-sass": "4.12.0",
+ "node-sass": "4.13.0",
"react": "16.10.2",
"react-dom": "16.11.0"
}
From 6258ec67053e187a0e1af5e8aeff807a2e9fa71f Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Sun, 3 Nov 2019 01:11:39 +0000
Subject: [PATCH 073/942] package.json: Update react package dependency
Closes #244
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 94f0820..b2b27a0 100644
--- a/package.json
+++ b/package.json
@@ -46,7 +46,7 @@
"dependencies": {
"core-js": "3.3.3",
"node-sass": "4.13.0",
- "react": "16.10.2",
+ "react": "16.11.0",
"react-dom": "16.11.0"
}
}
From e0a48cc9e067005854b3d81e85d8b3fc9ecb4d5e Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Wed, 6 Nov 2019 11:31:58 +0000
Subject: [PATCH 074/942] package.json: Update core-js package dependency
Closes #245
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index b2b27a0..d95b31c 100644
--- a/package.json
+++ b/package.json
@@ -44,7 +44,7 @@
"webpack-cli": "^3.1.0"
},
"dependencies": {
- "core-js": "3.3.3",
+ "core-js": "3.3.6",
"node-sass": "4.13.0",
"react": "16.11.0",
"react-dom": "16.11.0"
From 5c76af9747feaf4f7c38b65dfe074df680d70be1 Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Sat, 9 Nov 2019 12:27:25 +0000
Subject: [PATCH 075/942] package.json: Update core-js package dependency
Closes #246
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index d95b31c..46ed2db 100644
--- a/package.json
+++ b/package.json
@@ -44,7 +44,7 @@
"webpack-cli": "^3.1.0"
},
"dependencies": {
- "core-js": "3.3.6",
+ "core-js": "3.4.0",
"node-sass": "4.13.0",
"react": "16.11.0",
"react-dom": "16.11.0"
From daaa8630a09c15ab59bf06d4e15b617d5ec47618 Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Tue, 12 Nov 2019 16:01:48 +0000
Subject: [PATCH 076/942] package.json: Update core-js package dependency
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 46ed2db..2c78b4b 100644
--- a/package.json
+++ b/package.json
@@ -44,7 +44,7 @@
"webpack-cli": "^3.1.0"
},
"dependencies": {
- "core-js": "3.4.0",
+ "core-js": "3.4.1",
"node-sass": "4.13.0",
"react": "16.11.0",
"react-dom": "16.11.0"
From 13e75d37a34734cbb062fdcb1870ae9a639de5bc Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Fri, 15 Nov 2019 17:08:35 +0000
Subject: [PATCH 077/942] package.json: Update react package dependency
Closes #248
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 2c78b4b..9bfb182 100644
--- a/package.json
+++ b/package.json
@@ -46,7 +46,7 @@
"dependencies": {
"core-js": "3.4.1",
"node-sass": "4.13.0",
- "react": "16.11.0",
+ "react": "16.12.0",
"react-dom": "16.11.0"
}
}
From 37094da03a7a17d052cc847d52a157c9afcfa124 Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Tue, 19 Nov 2019 11:36:47 +0000
Subject: [PATCH 078/942] package.json: Update react-dom package dependency
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 9bfb182..af0a6ef 100644
--- a/package.json
+++ b/package.json
@@ -47,6 +47,6 @@
"core-js": "3.4.1",
"node-sass": "4.13.0",
"react": "16.12.0",
- "react-dom": "16.11.0"
+ "react-dom": "16.12.0"
}
}
From 31b696106652c9084fee28f369b7743222dd6330 Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Mon, 25 Nov 2019 11:47:58 +0000
Subject: [PATCH 079/942] package.json: Update core-js package dependency
Closes #250
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index af0a6ef..0610702 100644
--- a/package.json
+++ b/package.json
@@ -44,7 +44,7 @@
"webpack-cli": "^3.1.0"
},
"dependencies": {
- "core-js": "3.4.1",
+ "core-js": "3.4.2",
"node-sass": "4.13.0",
"react": "16.12.0",
"react-dom": "16.12.0"
From eb00b27a0e68571c41553925314b2c0e29410087 Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Thu, 28 Nov 2019 13:25:36 +0000
Subject: [PATCH 080/942] package.json: Update core-js package dependency
Closes #251
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 0610702..b655356 100644
--- a/package.json
+++ b/package.json
@@ -44,7 +44,7 @@
"webpack-cli": "^3.1.0"
},
"dependencies": {
- "core-js": "3.4.2",
+ "core-js": "3.4.5",
"node-sass": "4.13.0",
"react": "16.12.0",
"react-dom": "16.12.0"
From 3e56d25c50765ba14e34352e3cdd3cb46bd08176 Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Wed, 4 Dec 2019 17:36:41 +0000
Subject: [PATCH 081/942] package.json: Update core-js package dependency
Closes #253
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index b655356..11e1cc8 100644
--- a/package.json
+++ b/package.json
@@ -44,7 +44,7 @@
"webpack-cli": "^3.1.0"
},
"dependencies": {
- "core-js": "3.4.5",
+ "core-js": "3.4.7",
"node-sass": "4.13.0",
"react": "16.12.0",
"react-dom": "16.12.0"
From 0778b5f56417b933f381fe486de12eeab1ad58d5 Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Wed, 11 Dec 2019 16:50:57 +0000
Subject: [PATCH 082/942] package.json: Update core-js package dependency
Closes #255
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 11e1cc8..3a3b77e 100644
--- a/package.json
+++ b/package.json
@@ -44,7 +44,7 @@
"webpack-cli": "^3.1.0"
},
"dependencies": {
- "core-js": "3.4.7",
+ "core-js": "3.4.8",
"node-sass": "4.13.0",
"react": "16.12.0",
"react-dom": "16.12.0"
From c5506892964c063bc97b02c0a11a4b344a0704e1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Matej=20Maru=C5=A1=C3=A1k?=
Date: Thu, 12 Dec 2019 19:57:24 +0100
Subject: [PATCH 083/942] Bump version of test API
Closes #256
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 9c108b9..fbda17a 100644
--- a/Makefile
+++ b/Makefile
@@ -144,7 +144,7 @@ bots:
# checkout Cockpit's test API; this has no API stability guarantee, so check out a stable tag
# when you start a new project, use the latest relese, and update it from time to time
test/common:
- git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 202
+ git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 208
git checkout --force FETCH_HEAD -- test/common
git reset test/common
From 06206df7f3f0f42e7de09592e115803a52d3d069 Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Sat, 14 Dec 2019 22:20:18 +0000
Subject: [PATCH 084/942] package.json: Update core-js package dependency
Closes #257
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 3a3b77e..ed79efe 100644
--- a/package.json
+++ b/package.json
@@ -44,7 +44,7 @@
"webpack-cli": "^3.1.0"
},
"dependencies": {
- "core-js": "3.4.8",
+ "core-js": "3.5.0",
"node-sass": "4.13.0",
"react": "16.12.0",
"react-dom": "16.12.0"
From b0c2094b8bed0c862b5309ef17c42e375e2880bc Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Sat, 21 Dec 2019 11:26:52 +0000
Subject: [PATCH 085/942] package.json: Update core-js package dependency
Closes #259
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index ed79efe..a47e36d 100644
--- a/package.json
+++ b/package.json
@@ -44,7 +44,7 @@
"webpack-cli": "^3.1.0"
},
"dependencies": {
- "core-js": "3.5.0",
+ "core-js": "3.6.0",
"node-sass": "4.13.0",
"react": "16.12.0",
"react-dom": "16.12.0"
From 53fd7a27a9ea7f7dc33257720727122609a9646f Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Fri, 27 Dec 2019 17:37:12 +0000
Subject: [PATCH 086/942] package.json: Update core-js package dependency
Closes #261
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index a47e36d..76107bf 100644
--- a/package.json
+++ b/package.json
@@ -44,7 +44,7 @@
"webpack-cli": "^3.1.0"
},
"dependencies": {
- "core-js": "3.6.0",
+ "core-js": "3.6.1",
"node-sass": "4.13.0",
"react": "16.12.0",
"react-dom": "16.12.0"
From 10a168e282c9650134ade8dbb8776f1262322def Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Wed, 8 Jan 2020 22:03:41 +0000
Subject: [PATCH 087/942] package.json: Update core-js package dependency
Closes #265
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 76107bf..4253ea9 100644
--- a/package.json
+++ b/package.json
@@ -44,7 +44,7 @@
"webpack-cli": "^3.1.0"
},
"dependencies": {
- "core-js": "3.6.1",
+ "core-js": "3.6.2",
"node-sass": "4.13.0",
"react": "16.12.0",
"react-dom": "16.12.0"
From 4f51ce190bdb8aea3ab24e8c4179cce5e9c1b703 Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Sat, 11 Jan 2020 22:42:41 +0000
Subject: [PATCH 088/942] package.json: Update core-js package dependency
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 4253ea9..973c11f 100644
--- a/package.json
+++ b/package.json
@@ -44,7 +44,7 @@
"webpack-cli": "^3.1.0"
},
"dependencies": {
- "core-js": "3.6.2",
+ "core-js": "3.6.3",
"node-sass": "4.13.0",
"react": "16.12.0",
"react-dom": "16.12.0"
From c953db6dee5f563ca1277634a3ba63f21f934dd8 Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Wed, 15 Jan 2020 09:36:37 +0000
Subject: [PATCH 089/942] package.json: Update core-js package dependency
Closes #267
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 973c11f..582adcd 100644
--- a/package.json
+++ b/package.json
@@ -44,7 +44,7 @@
"webpack-cli": "^3.1.0"
},
"dependencies": {
- "core-js": "3.6.3",
+ "core-js": "3.6.4",
"node-sass": "4.13.0",
"react": "16.12.0",
"react-dom": "16.12.0"
From 7ec06ca6dc29f14c2acc7422643a0d0b509cb869 Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Sat, 18 Jan 2020 10:15:56 +0000
Subject: [PATCH 090/942] package.json: Update node-sass package dependency
Closes #268
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 582adcd..7ac34ff 100644
--- a/package.json
+++ b/package.json
@@ -45,7 +45,7 @@
},
"dependencies": {
"core-js": "3.6.4",
- "node-sass": "4.13.0",
+ "node-sass": "4.13.1",
"react": "16.12.0",
"react-dom": "16.12.0"
}
From 23e8eb1591e84ad0bd2b647e680e7f3bfe53898c Mon Sep 17 00:00:00 2001
From: Matej Marusak
Date: Mon, 27 Jan 2020 21:16:30 +0100
Subject: [PATCH 091/942] Replace 'extract-text-webpack-plugin' with
'mini-css-extract-plugin'
It looks like Webpack is deprecating extract-text-webpack-plugin in favor of
mini-css-extract-plugin.
Discussion can be found here: webpack-contrib/extract-text-webpack-plugin#731
Closes #271
---
package.json | 2 +-
webpack.config.js | 17 +++++++++++++----
2 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/package.json b/package.json
index 7ac34ff..c95967c 100644
--- a/package.json
+++ b/package.json
@@ -33,7 +33,7 @@
"eslint-plugin-react": "^7.14.3",
"eslint-plugin-react-hooks": "^2.1.2",
"eslint-plugin-standard": "^4.0.1",
- "extract-text-webpack-plugin": "^4.0.0-beta.0",
+ "mini-css-extract-plugin": "^0.9.0",
"htmlparser": "^1.7.7",
"jed": "^1.1.1",
"po2json": "^1.0.0-alpha",
diff --git a/webpack.config.js b/webpack.config.js
index eb78ca1..01973c4 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -1,6 +1,6 @@
const path = require("path");
const copy = require("copy-webpack-plugin");
-const extract = require("extract-text-webpack-plugin");
+const extract = require("mini-css-extract-plugin");
const fs = require("fs");
const webpack = require("webpack");
const CompressionPlugin = require("compression-webpack-plugin");
@@ -79,7 +79,7 @@ info.files = files;
var plugins = [
new copy(info.files),
- new extract("[name].css")
+ new extract({filename: "[name].css"})
];
/* Only minimize when in production mode */
@@ -134,8 +134,17 @@ module.exports = {
},
{
exclude: /node_modules/,
- loader: extract.extract('css-loader!sass-loader'),
- test: /\.scss$/
+ test: /\.scss$/,
+ use: [
+ extract.loader,
+ {
+ loader: 'css-loader',
+ options: { url: false }
+ },
+ {
+ loader: 'sass-loader',
+ }
+ ]
}
]
},
From ec85d30d0fdd1b5a3076485140f5ee1c4c3a5530 Mon Sep 17 00:00:00 2001
From: Matej Marusak
Date: Mon, 3 Feb 2020 10:55:05 +0100
Subject: [PATCH 092/942] manifest2po: Parse also keywords
---
po/manifest2po | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/po/manifest2po b/po/manifest2po
index 4d26db3..2dc691c 100755
--- a/po/manifest2po
+++ b/po/manifest2po
@@ -87,6 +87,17 @@ function process_manifest(manifest) {
process_menu(manifest.tools);
}
+function process_keywords(keywords) {
+ keywords.forEach(v => {
+ v.matches.forEach(keyword =>
+ push({
+ msgid: keyword,
+ locations: [ filename ]
+ })
+ );
+ });
+}
+
function process_menu(menu) {
for (var m in menu) {
if (menu[m].label) {
@@ -95,6 +106,8 @@ function process_menu(menu) {
locations: [ filename ]
});
}
+ if (menu[m].keywords)
+ process_keywords(menu[m].keywords);
}
}
From d9a67b1f86ee68a29960cc755574e31bb83d0eb4 Mon Sep 17 00:00:00 2001
From: Matej Marusak
Date: Mon, 3 Feb 2020 10:55:29 +0100
Subject: [PATCH 093/942] manifest2po: Parse also documentation
Closes #275
---
po/manifest2po | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/po/manifest2po b/po/manifest2po
index 2dc691c..5376ef8 100755
--- a/po/manifest2po
+++ b/po/manifest2po
@@ -98,6 +98,15 @@ function process_keywords(keywords) {
});
}
+function process_docs(docs) {
+ docs.forEach(doc => {
+ push({
+ msgid: doc.label,
+ locations: [ filename ]
+ })
+ });
+}
+
function process_menu(menu) {
for (var m in menu) {
if (menu[m].label) {
@@ -108,6 +117,8 @@ function process_menu(menu) {
}
if (menu[m].keywords)
process_keywords(menu[m].keywords);
+ if (menu[m].docs)
+ process_docs(menu[m].docs);
}
}
From fb8c3389abfafbb53de9daae4f2ea39bc8defa6f Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Sat, 29 Feb 2020 19:32:39 +0000
Subject: [PATCH 094/942] package.json: Update react package dependency
Closes #286
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index c95967c..07fbe94 100644
--- a/package.json
+++ b/package.json
@@ -46,7 +46,7 @@
"dependencies": {
"core-js": "3.6.4",
"node-sass": "4.13.1",
- "react": "16.12.0",
+ "react": "16.13.0",
"react-dom": "16.12.0"
}
}
From a711f04195e670b93e95f00c897a108998ff516f Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Tue, 3 Mar 2020 20:28:09 +0000
Subject: [PATCH 095/942] package.json: Update react-dom package dependency
Closes #287
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 07fbe94..a87cb4b 100644
--- a/package.json
+++ b/package.json
@@ -47,6 +47,6 @@
"core-js": "3.6.4",
"node-sass": "4.13.1",
"react": "16.13.0",
- "react-dom": "16.12.0"
+ "react-dom": "16.13.0"
}
}
From 696ef20f323cef83e845ccf1997a2e9c1ad599a3 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Tue, 10 Mar 2020 09:47:16 +0100
Subject: [PATCH 096/942] Bump cockpit test API to 213
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index fbda17a..e8c8c2c 100644
--- a/Makefile
+++ b/Makefile
@@ -144,7 +144,7 @@ bots:
# checkout Cockpit's test API; this has no API stability guarantee, so check out a stable tag
# when you start a new project, use the latest relese, and update it from time to time
test/common:
- git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 208
+ git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 213
git checkout --force FETCH_HEAD -- test/common
git reset test/common
From b0bf8afa48c3ea52b993225a6ec292f7e626def0 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Tue, 10 Mar 2020 10:05:32 +0100
Subject: [PATCH 097/942] test: Trim package installation
We don't need the full cockpit metapackage with cockpit-docker, etc.
The starter-kit RPM will already pull in cockpit-system, so we just need
cockpit-ws.
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index e8c8c2c..50dbf53 100644
--- a/Makefile
+++ b/Makefile
@@ -123,7 +123,7 @@ rpm: dist-gzip cockpit-$(PACKAGE_NAME).spec
# build a VM with locally built rpm installed
$(VM_IMAGE): rpm bots
rm -f $(VM_IMAGE) $(VM_IMAGE).qcow2
- bots/image-customize -v -i cockpit -i `pwd`/cockpit-$(PACKAGE_NAME)-*$(VERSION)*.noarch.rpm -s $(CURDIR)/test/vm.install $(TEST_OS)
+ bots/image-customize -v -i cockpit-ws -i `pwd`/cockpit-$(PACKAGE_NAME)-*$(VERSION)*.noarch.rpm -s $(CURDIR)/test/vm.install $(TEST_OS)
# convenience target for the above
vm: $(VM_IMAGE)
From 38bd17faef5a823ddf4931d2fd76b194aee8ff1d Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Tue, 10 Mar 2020 10:34:35 +0100
Subject: [PATCH 098/942] Make cockpit-starter-kit.spec.in rpmspec compliant
Use `%{VERSION}` as version macro instead of `@VERSION@`, so that the
.spec.in file is syntactically a correct spec file that can be parsed
with `rpmspec`.
---
Makefile | 2 +-
cockpit-starter-kit.spec.in | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 50dbf53..ff74dc7 100644
--- a/Makefile
+++ b/Makefile
@@ -61,7 +61,7 @@ dist/po.%.js: po/%.po $(NODE_MODULES_TEST)
#
%.spec: %.spec.in
- sed -e 's/@VERSION@/$(VERSION)/g' $< > $@
+ sed -e 's/%{VERSION}/$(VERSION)/g' $< > $@
$(WEBPACK_TEST): $(NODE_MODULES_TEST) $(shell find src/ -type f) package.json webpack.config.js $(patsubst %,dist/po.%.js,$(LINGUAS))
NODE_ENV=$(NODE_ENV) npm run build
diff --git a/cockpit-starter-kit.spec.in b/cockpit-starter-kit.spec.in
index 48f5b17..0207242 100644
--- a/cockpit-starter-kit.spec.in
+++ b/cockpit-starter-kit.spec.in
@@ -1,5 +1,5 @@
Name: cockpit-starter-kit
-Version: @VERSION@
+Version: %{VERSION}
Release: 1%{?dist}
Summary: Cockpit Starter Kit Example Module
License: LGPLv2+
From 115e5a885ffb4811ab7860c6288e1a94715515be Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Tue, 10 Mar 2020 10:50:08 +0100
Subject: [PATCH 099/942] Makefile: Use proper file dependencies
Avoid phony dependencies, as they break timestamp comparison and thus
always cause rebuilding of the tarball, rpm, and (the very expensive) VM
for each `make check`, even if only the tests (or nothing at all)
changed.
Use `rpmspec` to predict the name of the built rpm. Use the .spec.in
file directly, as we can't depend on the generated .spec file in the
variable definition.
Closes #290
---
Makefile | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/Makefile b/Makefile
index ff74dc7..7caed7d 100644
--- a/Makefile
+++ b/Makefile
@@ -5,6 +5,8 @@ ifeq ($(TEST_OS),)
TEST_OS = centos-7
endif
export TEST_OS
+TARFILE=cockpit-$(PACKAGE_NAME)-$(VERSION).tar.gz
+RPMFILE=$(shell rpmspec -D"VERSION $(VERSION)" -q cockpit-starter-kit.spec.in).rpm
VM_IMAGE=$(CURDIR)/test/images/$(TEST_OS)
# stamp file to check if/when npm install ran
NODE_MODULES_TEST=package-lock.json
@@ -84,12 +86,14 @@ devel-install: $(WEBPACK_TEST)
mkdir -p ~/.local/share/cockpit
ln -s `pwd`/dist ~/.local/share/cockpit/$(PACKAGE_NAME)
+dist-gzip: $(TARFILE)
+
# when building a distribution tarball, call webpack with a 'production' environment
# we don't ship node_modules for license and compactness reasons; we ship a
# pre-built dist/ (so it's not necessary) and ship packge-lock.json (so that
# node_modules/ can be reconstructed if necessary)
-dist-gzip: NODE_ENV=production
-dist-gzip: all cockpit-$(PACKAGE_NAME).spec
+$(TARFILE): NODE_ENV=production
+$(TARFILE): $(WEBPACK_TEST) cockpit-$(PACKAGE_NAME).spec
if type appstream-util >/dev/null 2>&1; then appstream-util validate-relax --nonet *.metainfo.xml; fi
mv node_modules node_modules.release
touch -r package.json $(NODE_MODULES_TEST)
@@ -99,13 +103,15 @@ dist-gzip: all cockpit-$(PACKAGE_NAME).spec
$$(git ls-files) package-lock.json cockpit-$(PACKAGE_NAME).spec dist/
mv node_modules.release node_modules
-srpm: dist-gzip cockpit-$(PACKAGE_NAME).spec
+srpm: $(TARFILE) cockpit-$(PACKAGE_NAME).spec
rpmbuild -bs \
--define "_sourcedir `pwd`" \
--define "_srcrpmdir `pwd`" \
cockpit-$(PACKAGE_NAME).spec
-rpm: dist-gzip cockpit-$(PACKAGE_NAME).spec
+rpm: $(RPMFILE)
+
+$(RPMFILE): $(TARFILE) cockpit-$(PACKAGE_NAME).spec
mkdir -p "`pwd`/output"
mkdir -p "`pwd`/rpmbuild"
rpmbuild -bb \
@@ -119,11 +125,13 @@ rpm: dist-gzip cockpit-$(PACKAGE_NAME).spec
find `pwd`/output -name '*.rpm' -printf '%f\n' -exec mv {} . \;
rm -r "`pwd`/rpmbuild"
rm -r "`pwd`/output" "`pwd`/build"
+ # sanity check
+ test -e "$(RPMFILE)"
# build a VM with locally built rpm installed
-$(VM_IMAGE): rpm bots
+$(VM_IMAGE): $(RPMFILE) bots
rm -f $(VM_IMAGE) $(VM_IMAGE).qcow2
- bots/image-customize -v -i cockpit-ws -i `pwd`/cockpit-$(PACKAGE_NAME)-*$(VERSION)*.noarch.rpm -s $(CURDIR)/test/vm.install $(TEST_OS)
+ bots/image-customize -v -i cockpit-ws -i `pwd`/$(RPMFILE) -s $(CURDIR)/test/vm.install $(TEST_OS)
# convenience target for the above
vm: $(VM_IMAGE)
From d544bda27102b25dcd02e8bdda9823e8bdb2228d Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Tue, 10 Mar 2020 11:20:37 +0100
Subject: [PATCH 100/942] test: Use test scenario for selecting browser
Similar to what cockpit-composer does. This is rather simplistic, but
does fine until we need more complex scenarios.
Also use plain shell in test/run, there are no bashisms.
Closes #291
---
test/run | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/test/run b/test/run
index 46a2d01..ed43e3a 100755
--- a/test/run
+++ b/test/run
@@ -1,4 +1,8 @@
-#! /bin/bash
+#! /bin/sh
+set -eu
+
# This is the expected entry point for Cockpit CI; will be called without
-# arguments but with an appropriate $TEST_OS
+# arguments but with an appropriate $TEST_OS, and optionally $TEST_SCENARIO
+
+[ -z "${TEST_SCENARIO:-}" ] || export TEST_BROWSER="$TEST_SCENARIO"
make check
From 1d0fd48e2d2c8c82f3a0f5586573ee4817b90d4a Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Sun, 22 Mar 2020 14:01:12 +0000
Subject: [PATCH 101/942] package.json: Update react package dependency
Closes #296
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index a87cb4b..ddd5f18 100644
--- a/package.json
+++ b/package.json
@@ -46,7 +46,7 @@
"dependencies": {
"core-js": "3.6.4",
"node-sass": "4.13.1",
- "react": "16.13.0",
+ "react": "16.13.1",
"react-dom": "16.13.0"
}
}
From 7836502c6b0cbb43734be01331c7cee41356fa33 Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Sat, 28 Mar 2020 19:38:31 +0000
Subject: [PATCH 102/942] package.json: Update react-dom package dependency
Closes #298
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index ddd5f18..a3cc6c0 100644
--- a/package.json
+++ b/package.json
@@ -47,6 +47,6 @@
"core-js": "3.6.4",
"node-sass": "4.13.1",
"react": "16.13.1",
- "react-dom": "16.13.0"
+ "react-dom": "16.13.1"
}
}
From 30f646bfa18c3919c6977eb30f1fa8d1e0c05e8e Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Fri, 10 Apr 2020 01:48:40 +0000
Subject: [PATCH 103/942] package.json: Update core-js package dependency
Closes #302
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index a3cc6c0..750d2a0 100644
--- a/package.json
+++ b/package.json
@@ -44,7 +44,7 @@
"webpack-cli": "^3.1.0"
},
"dependencies": {
- "core-js": "3.6.4",
+ "core-js": "3.6.5",
"node-sass": "4.13.1",
"react": "16.13.1",
"react-dom": "16.13.1"
From 744c1ddb6e96a27b723f50c088c2134fd705a918 Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Sat, 25 Apr 2020 07:28:41 +0000
Subject: [PATCH 104/942] package.json: Update node-sass package dependency
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 750d2a0..cc09737 100644
--- a/package.json
+++ b/package.json
@@ -45,7 +45,7 @@
},
"dependencies": {
"core-js": "3.6.5",
- "node-sass": "4.13.1",
+ "node-sass": "4.14.0",
"react": "16.13.1",
"react-dom": "16.13.1"
}
From ccc8d7fc8973af5f9e7c62f8430bdeb9c250f131 Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Thu, 7 May 2020 22:18:37 +0000
Subject: [PATCH 105/942] package.json: Update node-sass package dependency
Closes #311
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index cc09737..d9ab2b1 100644
--- a/package.json
+++ b/package.json
@@ -45,7 +45,7 @@
},
"dependencies": {
"core-js": "3.6.5",
- "node-sass": "4.14.0",
+ "node-sass": "4.14.1",
"react": "16.13.1",
"react-dom": "16.13.1"
}
From 8adad168747fc1032a1ea7976a7aa886ea893469 Mon Sep 17 00:00:00 2001
From: Matej Marusak
Date: Sat, 23 May 2020 07:51:00 +0200
Subject: [PATCH 106/942] Bump up version of test/common
There has been a lot of improvements since 213 and also due to new
privilege escalation this is need.
Closes #317
---
Makefile | 4 ++--
test/vm.install | 3 +++
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 7caed7d..ae129f5 100644
--- a/Makefile
+++ b/Makefile
@@ -150,9 +150,9 @@ bots:
@echo "checked out bots/ ref $$(git -C bots rev-parse HEAD)"
# checkout Cockpit's test API; this has no API stability guarantee, so check out a stable tag
-# when you start a new project, use the latest relese, and update it from time to time
+# when you start a new project, use the latest release, and update it from time to time
test/common:
- git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 213
+ git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 219
git checkout --force FETCH_HEAD -- test/common
git reset test/common
diff --git a/test/vm.install b/test/vm.install
index 55e548d..5241745 100644
--- a/test/vm.install
+++ b/test/vm.install
@@ -10,3 +10,6 @@ if type firewall-cmd >/dev/null 2>&1; then
firewall-cmd --add-service=cockpit --permanent
fi
systemctl enable cockpit.socket
+
+# HACK: See https://github.com/cockpit-project/cockpit/issues/14133
+mkdir -p /usr/share/cockpit/packagekit
From 96514e279e540c5a1cbea06f4a4ab29b42ddaf3a Mon Sep 17 00:00:00 2001
From: Katerina Koukiou
Date: Thu, 28 May 2020 10:01:31 +0200
Subject: [PATCH 107/942] main: Stop importing patternfly.css
* Stop importing cockpit's base1/patternfly.css
This is deprecated API and will be dropped at some point, in favor
of projects shipping their own CSS.
Install and import the styles from PF4 now.
* Use webpack based string replacement for removing the font-face rules from PF4
Doing the seddery in Makefile breaks `npm run build`, webpack watching,
and is generally brittle.
Do the font replacement hacking with `string-replace-loader`, which fits into webpack much more nicely.
There is still some potential simplification by not duplicating the
entire scss loader chain.
Co-authored-by: Martin Pitt
Closes #315
---
package.json | 7 ++--
src/app.jsx | 20 +++++++----
src/index.html | 3 +-
src/index.js | 10 ++++++
src/lib/_fonts.scss | 36 +++++++++++++++++++
src/lib/patternfly-4-cockpit.scss | 14 ++++++++
src/lib/patternfly-4-overrides.scss | 43 ++++++++++++++++++++++
test/check-application | 8 ++---
webpack.config.js | 56 ++++++++++++++++++++++++++---
9 files changed, 178 insertions(+), 19 deletions(-)
create mode 100644 src/lib/_fonts.scss
create mode 100644 src/lib/patternfly-4-cockpit.scss
create mode 100644 src/lib/patternfly-4-overrides.scss
diff --git a/package.json b/package.json
index d9ab2b1..9a7cdee 100644
--- a/package.json
+++ b/package.json
@@ -33,19 +33,22 @@
"eslint-plugin-react": "^7.14.3",
"eslint-plugin-react-hooks": "^2.1.2",
"eslint-plugin-standard": "^4.0.1",
- "mini-css-extract-plugin": "^0.9.0",
"htmlparser": "^1.7.7",
"jed": "^1.1.1",
+ "mini-css-extract-plugin": "^0.9.0",
+ "node-sass": "4.14.1",
"po2json": "^1.0.0-alpha",
"sass-loader": "^7.0.3",
"sizzle": "^2.3.3",
"stdio": "^0.2.7",
+ "string-replace-loader": "^2.3.0",
"webpack": "^4.17.1",
"webpack-cli": "^3.1.0"
},
"dependencies": {
+ "@patternfly/patternfly": "^2.71.6",
+ "@patternfly/react-core": "^3.158.1",
"core-js": "3.6.5",
- "node-sass": "4.14.1",
"react": "16.13.1",
"react-dom": "16.13.1"
}
diff --git a/src/app.jsx b/src/app.jsx
index 1f671a9..9f17f50 100644
--- a/src/app.jsx
+++ b/src/app.jsx
@@ -19,6 +19,7 @@
import cockpit from 'cockpit';
import React from 'react';
+import { Alert, Card, CardHead, CardHeader, CardHeadMain, Title } from '@patternfly/react-core';
import './app.scss';
const _ = cockpit.gettext;
@@ -35,12 +36,19 @@ export class Application extends React.Component {
render() {
return (
-
-
Starter Kit
-
- { cockpit.format(_("Running on $0"), this.state.hostname) }
-
-
+
+
+
+ Starter Kit
+
+
+
+
+
+
);
}
}
diff --git a/src/index.html b/src/index.html
index 5182d9b..62a2bf0 100644
--- a/src/index.html
+++ b/src/index.html
@@ -22,7 +22,6 @@ along with this package; If not, see .
-
@@ -30,7 +29,7 @@ along with this package; If not, see .
-
+
diff --git a/src/index.js b/src/index.js
index 0a0e535..85fa0c4 100644
--- a/src/index.js
+++ b/src/index.js
@@ -17,11 +17,21 @@
* along with Cockpit; If not, see .
*/
+import "./lib/patternfly-4-cockpit.scss";
+
import "core-js/stable";
import React from 'react';
import ReactDOM from 'react-dom';
import { Application } from './app.jsx';
+/*
+ * PF4 overrides need to come after the JSX components imports because
+ * these are importing CSS stylesheets that we are overriding
+ * Having the overrides here will ensure that when mini-css-extract-plugin will extract the CSS
+ * out of the dist/index.js and since it will maintain the order of the imported CSS,
+ * the overrides will be correctly in the end of our stylesheet.
+ */
+import "./lib/patternfly-4-overrides.scss";
document.addEventListener("DOMContentLoaded", function () {
ReactDOM.render(React.createElement(Application, {}), document.getElementById('app'));
diff --git a/src/lib/_fonts.scss b/src/lib/_fonts.scss
new file mode 100644
index 0000000..b3cb18a
--- /dev/null
+++ b/src/lib/_fonts.scss
@@ -0,0 +1,36 @@
+/*
+ * Keep in sync with https://github.com/cockpit-project/cockpit/tree/master/src/base1/_fonts.scss
+ */
+
+@mixin printRedHatFont(
+$weightValue: 400,
+$weightName: "Regular",
+$familyName: "RedHatText",
+$style: "normal",
+$relative: true
+) {
+ $filePath: "../../static/fonts" + "/" + $familyName + "-" + $weightName;
+ @font-face {
+ font-family: $familyName;
+ src: url('#{$filePath}.woff2') format('woff2');
+ font-style: #{$style};
+ font-weight: $weightValue;
+ text-rendering: optimizeLegibility;
+ }
+}
+
+@include printRedHatFont(700, "Bold", $familyName: "RedHatDisplay");
+@include printRedHatFont(700, "BoldItalic", $style: "italic", $familyName: "RedHatDisplay");
+@include printRedHatFont(300, "Black", $familyName: "RedHatDisplay");
+@include printRedHatFont(300, "BlackItalic", $style: "italic", $familyName: "RedHatDisplay");
+@include printRedHatFont(300, "Italic", $style: "italic", $familyName: "RedHatDisplay");
+@include printRedHatFont(400, "Medium", $familyName: "RedHatDisplay");
+@include printRedHatFont(400, "MediumItalic", $style: "italic", $familyName: "RedHatDisplay");
+@include printRedHatFont(300, "Regular", $familyName: "RedHatDisplay");
+
+@include printRedHatFont(300, "Bold");
+@include printRedHatFont(300, "BoldItalic", $style: "italic");
+@include printRedHatFont(300, "Italic");
+@include printRedHatFont(700, "Medium");
+@include printRedHatFont(700, "MediumItalic", $style: "italic");
+@include printRedHatFont(400, "Regular");
diff --git a/src/lib/patternfly-4-cockpit.scss b/src/lib/patternfly-4-cockpit.scss
new file mode 100644
index 0000000..40da84e
--- /dev/null
+++ b/src/lib/patternfly-4-cockpit.scss
@@ -0,0 +1,14 @@
+/*
+ * Keep in sync with https://github.com/cockpit-project/cockpit/tree/master/src/base1/patternfly-4-cockpit.scss
+ */
+
+/* Set fake font and icon path variables - we are going to indentify these through
+ * string replacement and remove the relevant font-face declarations
+ */
+$pf-global--font-path: 'patternfly-fonts-fake-path';
+$pf-global--fonticon-path: 'patternfly-icons-fake-path';
+$pf-global--disable-fontawesome: true !default; // Disable Font Awesome 5 Free
+@import '@patternfly/patternfly/patternfly-base.scss';
+
+/* Import our own fonts since the PF4 font-face rules are filtered out with patternfly.sed */
+@import "./fonts";
diff --git a/src/lib/patternfly-4-overrides.scss b/src/lib/patternfly-4-overrides.scss
new file mode 100644
index 0000000..a02cb95
--- /dev/null
+++ b/src/lib/patternfly-4-overrides.scss
@@ -0,0 +1,43 @@
+/*
+ * Keep in sync with https://github.com/cockpit-project/cockpit/tree/master/pkg/lib/patternfly-4-overrides.scss
+ */
+
+/*** PF4 overrides ***/
+
+/* WORKAROUND: Override word-break bug */
+/* See: https://github.com/patternfly/patternfly-next/issues/2325 */
+.pf-c-table td {
+ word-break: normal;
+ overflow-wrap: break-word;
+}
+
+/* WORKAROUND: Dropdown (PF4): Caret is not properly aligned bug */
+/* See: https://github.com/patternfly/patternfly/issues/2715 */
+/* Align the icons inside of all dropdown toggles. */
+/* Part 1 of 2 */
+.pf-c-dropdown__toggle-button {
+ display: flex;
+ align-items: center;
+}
+
+/* Make split button dropdowns the same height as their sibling. */
+/* Part 2 of 2 */
+.pf-m-split-button {
+ align-items: stretch;
+}
+
+/* WORKAROUND: Navigation problems with Tertiary Nav widget on mobile */
+/* See: https://github.com/patternfly/patternfly-design/issues/840 */
+/* Helper mod to wrap pf-c-nav__tertiary */
+.ct-m-nav__tertiary-wrap {
+ flex-wrap: wrap;
+
+ .pf-c-nav__scroll-button {
+ display: none;
+ }
+}
+
+/* Helper mod to center pf-c-nav__tertiary when it wraps */
+.ct-m-nav__tertiary-center {
+ justify-content: center;
+}
diff --git a/test/check-application b/test/check-application
index 2ad5d68..c4068b2 100755
--- a/test/check-application
+++ b/test/check-application
@@ -20,16 +20,16 @@ class TestApplication(testlib.MachineCase):
self.login_and_go("/starter-kit")
# verify expected heading
- b.wait_text(".container-fluid h2", "Starter Kit")
+ b.wait_text("h2.pf-c-title", "Starter Kit")
# verify expected host name
hostname = m.execute("hostname").strip()
- b.wait_text(".container-fluid p", "Running on " + hostname)
+ b.wait_in_text("h4.pf-c-alert__title", "Running on " + hostname)
# change current hostname
m.execute("echo new-%s > /etc/hostname" % hostname)
# verify new hostname name
- b.wait_text(".container-fluid p", "Running on new-" + hostname)
+ b.wait_in_text("h4.pf-c-alert__title", "Running on new-" + hostname)
# change language to German
b.switch_to_top()
@@ -48,7 +48,7 @@ class TestApplication(testlib.MachineCase):
b.go("/starter-kit")
b.enter_page("/starter-kit")
# page label (from js) should be translated
- b.wait_in_text(".container-fluid p", "Läuft auf")
+ b.wait_in_text("h4.pf-c-alert__title", "Läuft auf")
if __name__ == '__main__':
testlib.test_main()
diff --git a/webpack.config.js b/webpack.config.js
index 01973c4..dccce9d 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -115,6 +115,9 @@ var babel_loader = {
module.exports = {
mode: production ? 'production' : 'development',
+ resolve: {
+ modules: [ nodedir ],
+ },
entry: info.entries,
externals: externals,
output: output,
@@ -132,20 +135,63 @@ module.exports = {
use: babel_loader,
test: /\.(js|jsx)$/
},
+ /* HACK: remove unwanted fonts from PatternFly's css */
{
- exclude: /node_modules/,
- test: /\.scss$/,
+ test: /patternfly-4-cockpit.scss$/,
use: [
extract.loader,
{
loader: 'css-loader',
- options: { url: false }
+ options: {
+ sourceMap: true,
+ url: false
+ }
+ },
+ {
+ loader: 'string-replace-loader',
+ options: {
+ multiple: [
+ {
+ search: /src:url\("patternfly-icons-fake-path\/pficon[^}]*/g,
+ replace: "src:url('fonts/patternfly.woff')format('woff');",
+ },
+ {
+ search: /@font-face[^}]*patternfly-fonts-fake-path[^}]*}/g,
+ replace: '',
+ },
+ ]
+ },
},
{
loader: 'sass-loader',
- }
+ options: {
+ sourceMap: true,
+ outputStyle: 'compressed',
+ },
+ },
]
- }
+ },
+ {
+ test: /\.s?css$/,
+ exclude: /patternfly-4-cockpit.scss/,
+ use: [
+ extract.loader,
+ {
+ loader: 'css-loader',
+ options: {
+ sourceMap: true,
+ url: false
+ }
+ },
+ {
+ loader: 'sass-loader',
+ options: {
+ sourceMap: true,
+ outputStyle: 'compressed',
+ },
+ },
+ ]
+ },
]
},
plugins: plugins
From c083e8a7cfe817d38a7db01d2368b1899f0e9a12 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Thu, 28 May 2020 10:14:12 +0200
Subject: [PATCH 108/942] package.json: Fix versions
Use ^ for node-sass, it's a development dependency.
Drop the ^ for patternfly, as these are runtime dependencies controlled
by our npm-update bot.
---
package.json | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/package.json b/package.json
index 9a7cdee..339e787 100644
--- a/package.json
+++ b/package.json
@@ -36,7 +36,7 @@
"htmlparser": "^1.7.7",
"jed": "^1.1.1",
"mini-css-extract-plugin": "^0.9.0",
- "node-sass": "4.14.1",
+ "node-sass": "^4.14.1",
"po2json": "^1.0.0-alpha",
"sass-loader": "^7.0.3",
"sizzle": "^2.3.3",
@@ -46,8 +46,8 @@
"webpack-cli": "^3.1.0"
},
"dependencies": {
- "@patternfly/patternfly": "^2.71.6",
- "@patternfly/react-core": "^3.158.1",
+ "@patternfly/patternfly": "2.71.6",
+ "@patternfly/react-core": "3.158.1",
"core-js": "3.6.5",
"react": "16.13.1",
"react-dom": "16.13.1"
From c039821e185cc2078501aeb073f6ba0925dc185b Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Thu, 28 May 2020 10:18:30 +0200
Subject: [PATCH 109/942] README: Bump fedora version
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 4700153..09e4e5b 100644
--- a/README.md
+++ b/README.md
@@ -78,7 +78,7 @@ the VM, possibly with extra options for tracing and halting on test failures
You can also run the test against a different Cockpit image, for example:
- TEST_OS=fedora-28 make check
+ TEST_OS=fedora-32 make check
# Vagrant
From 4166f0a5d4aec7e398989a6b35d71c5a51a06cd8 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Thu, 28 May 2020 10:32:17 +0200
Subject: [PATCH 110/942] Use cockpit 220's test runner
This will format the test output as TAP and thus provide nice log.html
output.
Closes #320
---
Makefile | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index ae129f5..f8bfec0 100644
--- a/Makefile
+++ b/Makefile
@@ -138,8 +138,9 @@ vm: $(VM_IMAGE)
echo $(VM_IMAGE)
# run the browser integration tests; skip check for SELinux denials
+# this will run all tests/check-* and format them as TAP
check: $(NODE_MODULES_TEST) $(VM_IMAGE) test/common
- TEST_AUDIT_NO_SELINUX=1 test/check-application
+ TEST_AUDIT_NO_SELINUX=1 test/common/run-tests
# checkout Cockpit's bots for standard test VM images and API to launch them
# must be from master, as only that has current and existing images; but testvm.py API is stable
@@ -152,7 +153,7 @@ bots:
# checkout Cockpit's test API; this has no API stability guarantee, so check out a stable tag
# when you start a new project, use the latest release, and update it from time to time
test/common:
- git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 219
+ git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 220
git checkout --force FETCH_HEAD -- test/common
git reset test/common
From 5660330c4c34b6a14bc563c094bd152c18da166e Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Fri, 29 May 2020 11:16:35 +0200
Subject: [PATCH 111/942] Drop Vagrantfile
Nobody in the development team has ever really used that, it needs a ton
of dependencies, and doesn't work in toolbox/Silverblue. Our own
vm-run/image-customize etc. machinery is efficient enough, and proven to
work.
Closes #321
---
README.md | 8 --------
Vagrantfile | 30 ------------------------------
2 files changed, 38 deletions(-)
delete mode 100644 Vagrantfile
diff --git a/README.md b/README.md
index 09e4e5b..ceff4cc 100644
--- a/README.md
+++ b/README.md
@@ -80,14 +80,6 @@ You can also run the test against a different Cockpit image, for example:
TEST_OS=fedora-32 make check
-# Vagrant
-
-This directory contains a Vagrantfile that installs and starts cockpit on a
-Fedora 26 cloud image. Run `vagrant up` to start it and `vagrant rsync` to
-synchronize the `dist` directory to `/usr/local/share/cockit/starter-kit`. Use
-`vagrant rsync-auto` to automatically sync when contents of the `dist`
-directory change.
-
# Customizing
After cloning the Starter Kit you should rename the files, package names, and
diff --git a/Vagrantfile b/Vagrantfile
deleted file mode 100644
index c446c94..0000000
--- a/Vagrantfile
+++ /dev/null
@@ -1,30 +0,0 @@
-Vagrant.configure(2) do |config|
- config.vm.box = "fedora/28-cloud-base"
- config.vm.network "forwarded_port", guest: 9090, host: 9090
-
- if Dir.glob("dist/*").length == 0
- config.vm.post_up_message = "NOTE: Distribution directory is empty. Run `make` to see your module show up in cockpit"
- end
-
- config.vm.synced_folder ".", "/vagrant", disabled: true
- config.vm.synced_folder "dist/", "/usr/local/share/cockpit/" + File.basename(Dir.pwd), type: "rsync", create: true
-
- config.vm.provider "libvirt" do |libvirt|
- libvirt.memory = 1024
- end
-
- config.vm.provider "virtualbox" do |virtualbox|
- virtualbox.memory = 1024
- end
-
- config.vm.provision "shell", inline: <<-EOF
- set -eu
-
- sudo dnf install -y cockpit
-
- printf "[WebService]\nAllowUnencrypted=true\n" > /etc/cockpit/cockpit.conf
-
- systemctl enable cockpit.socket
- systemctl start cockpit.socket
- EOF
-end
From 820549d86240a2c98cbbc72b2ca673a61b7154d1 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Tue, 2 Jun 2020 08:44:49 +0200
Subject: [PATCH 112/942] test: Adjust to new navigation in Cockpit 220
The parent element `#navbar-dropdown` exists in both old and new
versions.
Closes #325
---
test/check-application | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/check-application b/test/check-application
index c4068b2..38a28ae 100755
--- a/test/check-application
+++ b/test/check-application
@@ -33,7 +33,7 @@ class TestApplication(testlib.MachineCase):
# change language to German
b.switch_to_top()
- b.click("#content-user-name")
+ b.click("#navbar-dropdown")
b.click(".display-language-menu a")
b.wait_popup('display-language')
b.set_val("#display-language select", "de-de")
From f2644bff9bd49363aa76ff69ddffe37f7bc72d0d Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Sat, 13 Jun 2020 10:43:41 +0000
Subject: [PATCH 113/942] package.json: Update @patternfly/react-core package
dependency
Closes #329
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 339e787..cc88222 100644
--- a/package.json
+++ b/package.json
@@ -47,7 +47,7 @@
},
"dependencies": {
"@patternfly/patternfly": "2.71.6",
- "@patternfly/react-core": "3.158.1",
+ "@patternfly/react-core": "3.158.3",
"core-js": "3.6.5",
"react": "16.13.1",
"react-dom": "16.13.1"
From 96dfac3862755cdbf2929b9f94cb60ef718ef693 Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Tue, 23 Jun 2020 14:31:39 +0000
Subject: [PATCH 114/942] package.json: Update @patternfly/patternfly package
dependency
Closes #332
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index cc88222..17d3709 100644
--- a/package.json
+++ b/package.json
@@ -46,7 +46,7 @@
"webpack-cli": "^3.1.0"
},
"dependencies": {
- "@patternfly/patternfly": "2.71.6",
+ "@patternfly/patternfly": "2.71.7",
"@patternfly/react-core": "3.158.3",
"core-js": "3.6.5",
"react": "16.13.1",
From f2a11ba1deecb44cf9944eafddd2aabf9f888aee Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Mon, 29 Jun 2020 22:16:55 +0200
Subject: [PATCH 115/942] npm: Bump development dependencies
Closes #334
---
package.json | 15 ++++++++-------
webpack.config.js | 10 +++++++---
2 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/package.json b/package.json
index 17d3709..10b4645 100644
--- a/package.json
+++ b/package.json
@@ -17,10 +17,10 @@
"@babel/preset-env": "^7.5.4",
"@babel/preset-react": "^7.0.0",
"babel-eslint": "^10.0.3",
- "babel-loader": "^8.0.0",
+ "babel-loader": "^8.0.6",
"chrome-remote-interface": "^0.28.0",
- "compression-webpack-plugin": "^1.1.11",
- "copy-webpack-plugin": "^4.5.2",
+ "compression-webpack-plugin": "^3.0.0",
+ "copy-webpack-plugin": "^5.0.3",
"css-loader": "^3.0.0",
"eslint": "^6.3.0",
"eslint-config-standard": "^14.1.0",
@@ -30,7 +30,7 @@
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-node": "^10.0.0",
"eslint-plugin-promise": "^4.2.1",
- "eslint-plugin-react": "^7.14.3",
+ "eslint-plugin-react": "^7.16.0",
"eslint-plugin-react-hooks": "^2.1.2",
"eslint-plugin-standard": "^4.0.1",
"htmlparser": "^1.7.7",
@@ -38,12 +38,13 @@
"mini-css-extract-plugin": "^0.9.0",
"node-sass": "^4.14.1",
"po2json": "^1.0.0-alpha",
- "sass-loader": "^7.0.3",
+ "qunit": "^2.9.3",
+ "sass-loader": "^8.0.2",
"sizzle": "^2.3.3",
"stdio": "^0.2.7",
"string-replace-loader": "^2.3.0",
- "webpack": "^4.17.1",
- "webpack-cli": "^3.1.0"
+ "webpack": "^4.35.3",
+ "webpack-cli": "^3.3.5"
},
"dependencies": {
"@patternfly/patternfly": "2.71.7",
diff --git a/webpack.config.js b/webpack.config.js
index dccce9d..2b2f3e3 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -88,13 +88,13 @@ if (production) {
output.filename = "[name].min.js";
plugins.unshift(new CompressionPlugin({
- asset: "[path].gz[query]",
test: /\.(js|html)$/,
minRatio: 0.9,
deleteOriginalAssets: true
}));
}
+/* keep this in sync with cockpit.git */
var babel_loader = {
loader: "babel-loader",
options: {
@@ -165,8 +165,10 @@ module.exports = {
{
loader: 'sass-loader',
options: {
+ sassOptions: {
+ outputStyle: 'compressed',
+ },
sourceMap: true,
- outputStyle: 'compressed',
},
},
]
@@ -186,8 +188,10 @@ module.exports = {
{
loader: 'sass-loader',
options: {
+ sassOptions: {
+ outputStyle: 'compressed',
+ },
sourceMap: true,
- outputStyle: 'compressed',
},
},
]
From 2bb8e01d2d6bef6d715f508503c6a22963458f00 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Tue, 21 Jul 2020 10:33:48 +0200
Subject: [PATCH 116/942] Port to PatternFly 4.x
Closes #343
---
package.json | 4 ++--
src/app.jsx | 14 +++++---------
test/check-application | 8 ++++----
3 files changed, 11 insertions(+), 15 deletions(-)
diff --git a/package.json b/package.json
index 10b4645..0388d71 100644
--- a/package.json
+++ b/package.json
@@ -47,8 +47,8 @@
"webpack-cli": "^3.3.5"
},
"dependencies": {
- "@patternfly/patternfly": "2.71.7",
- "@patternfly/react-core": "3.158.3",
+ "@patternfly/patternfly": "4.23.3",
+ "@patternfly/react-core": "4.32.1",
"core-js": "3.6.5",
"react": "16.13.1",
"react-dom": "16.13.1"
diff --git a/src/app.jsx b/src/app.jsx
index 9f17f50..fd9d3df 100644
--- a/src/app.jsx
+++ b/src/app.jsx
@@ -19,7 +19,7 @@
import cockpit from 'cockpit';
import React from 'react';
-import { Alert, Card, CardHead, CardHeader, CardHeadMain, Title } from '@patternfly/react-core';
+import { Alert, Card, CardTitle, CardBody } from '@patternfly/react-core';
import './app.scss';
const _ = cockpit.gettext;
@@ -37,17 +37,13 @@ export class Application extends React.Component {
render() {
return (
-
-
- Starter Kit
-
-
-
+ Starter Kit
+
-
+
);
}
diff --git a/test/check-application b/test/check-application
index 38a28ae..826e0ad 100755
--- a/test/check-application
+++ b/test/check-application
@@ -20,16 +20,16 @@ class TestApplication(testlib.MachineCase):
self.login_and_go("/starter-kit")
# verify expected heading
- b.wait_text("h2.pf-c-title", "Starter Kit")
+ b.wait_text(".pf-c-card__title", "Starter Kit")
# verify expected host name
hostname = m.execute("hostname").strip()
- b.wait_in_text("h4.pf-c-alert__title", "Running on " + hostname)
+ b.wait_in_text(".pf-c-alert__title", "Running on " + hostname)
# change current hostname
m.execute("echo new-%s > /etc/hostname" % hostname)
# verify new hostname name
- b.wait_in_text("h4.pf-c-alert__title", "Running on new-" + hostname)
+ b.wait_in_text(".pf-c-alert__title", "Running on new-" + hostname)
# change language to German
b.switch_to_top()
@@ -48,7 +48,7 @@ class TestApplication(testlib.MachineCase):
b.go("/starter-kit")
b.enter_page("/starter-kit")
# page label (from js) should be translated
- b.wait_in_text("h4.pf-c-alert__title", "Läuft auf")
+ b.wait_in_text(".pf-c-alert__title", "Läuft auf")
if __name__ == '__main__':
testlib.test_main()
From 49a721354c6ed79dfc49ed36756d265a1a2c3264 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Thu, 23 Jul 2020 18:04:54 +0200
Subject: [PATCH 117/942] Exclude node_modules from webpack watching
This recently started to overflow inotify, and we don't need that --
it's fine to restart webpack when changing package.json, and it happens
rarely enough.
Closes #345
---
webpack.config.js | 3 +++
1 file changed, 3 insertions(+)
diff --git a/webpack.config.js b/webpack.config.js
index 2b2f3e3..9929619 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -118,6 +118,9 @@ module.exports = {
resolve: {
modules: [ nodedir ],
},
+ watchOptions: {
+ ignored: /node_modules/,
+ },
entry: info.entries,
externals: externals,
output: output,
From cd778dbe123c48d7540c34e261b2ec31097ec350 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Wed, 5 Aug 2020 11:58:12 +0200
Subject: [PATCH 118/942] Bump Cockpit test API to 224
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index f8bfec0..0273d5a 100644
--- a/Makefile
+++ b/Makefile
@@ -153,7 +153,7 @@ bots:
# checkout Cockpit's test API; this has no API stability guarantee, so check out a stable tag
# when you start a new project, use the latest release, and update it from time to time
test/common:
- git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 220
+ git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 224
git checkout --force FETCH_HEAD -- test/common
git reset test/common
From 7aa26f19ad35d3647fcf143dfb90cc8015aab344 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Wed, 5 Aug 2020 11:59:26 +0200
Subject: [PATCH 119/942] travis: Move to Ubuntu 20.04 LTS
Trusty, aka 14.04 LTS, is not officially supported any more.
---
.travis.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.travis.yml b/.travis.yml
index e5d53fc..2b45223 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,4 +1,4 @@
-dist: trusty
+dist: bionic
sudo: false
language: node_js
node_js:
From fc4333b50e2eafd097c996320d7b2684109cd404 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Wed, 5 Aug 2020 12:01:19 +0200
Subject: [PATCH 120/942] Makefile: Don't hardcode starter-kit in variable
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 0273d5a..1325afa 100644
--- a/Makefile
+++ b/Makefile
@@ -6,7 +6,7 @@ TEST_OS = centos-7
endif
export TEST_OS
TARFILE=cockpit-$(PACKAGE_NAME)-$(VERSION).tar.gz
-RPMFILE=$(shell rpmspec -D"VERSION $(VERSION)" -q cockpit-starter-kit.spec.in).rpm
+RPMFILE=$(shell rpmspec -D"VERSION $(VERSION)" -q cockpit-$(PACKAGE_NAME).spec.in).rpm
VM_IMAGE=$(CURDIR)/test/images/$(TEST_OS)
# stamp file to check if/when npm install ran
NODE_MODULES_TEST=package-lock.json
From be1f24b8bc88a9a0747c37bf68b02df532b18aaf Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Wed, 5 Aug 2020 12:01:49 +0200
Subject: [PATCH 121/942] metainfo: Fix launchable and update description
`` must coincide with the actual URL path defined by the
manifest.
Remove the period from ``, as the spec [1] suggests.
[1] https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#sect-Metadata-GenericComponent
Closes #350
---
org.cockpit-project.starter-kit.metainfo.xml | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/org.cockpit-project.starter-kit.metainfo.xml b/org.cockpit-project.starter-kit.metainfo.xml
index 3545eca..fb09a1a 100644
--- a/org.cockpit-project.starter-kit.metainfo.xml
+++ b/org.cockpit-project.starter-kit.metainfo.xml
@@ -3,14 +3,12 @@
org.cockpit_project.starter_kit
CC0-1.0
Starter Kit
-
- Scaffolding for a cockpit module.
-
+ Scaffolding for a cockpit module
Scaffolding for a cockpit module.
org.cockpit_project.cockpit
- cockpit-starter-kit
+ starter-kit
From 427f85795a16c1974e5ba7541e510b4005da0d81 Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Wed, 19 Aug 2020 15:44:42 +0000
Subject: [PATCH 122/942] package.json: Update @patternfly/react-core package
dependency
Closes #355
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 0388d71..9325ea1 100644
--- a/package.json
+++ b/package.json
@@ -48,7 +48,7 @@
},
"dependencies": {
"@patternfly/patternfly": "4.23.3",
- "@patternfly/react-core": "4.32.1",
+ "@patternfly/react-core": "4.40.4",
"core-js": "3.6.5",
"react": "16.13.1",
"react-dom": "16.13.1"
From 33d1b4425d7166de0efb5cc38dff3bd27b9c9564 Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Thu, 27 Aug 2020 12:42:22 +0000
Subject: [PATCH 123/942] package.json: Update @patternfly/patternfly package
dependency
Closes #358
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 9325ea1..1e16b2e 100644
--- a/package.json
+++ b/package.json
@@ -47,7 +47,7 @@
"webpack-cli": "^3.3.5"
},
"dependencies": {
- "@patternfly/patternfly": "4.23.3",
+ "@patternfly/patternfly": "4.35.2",
"@patternfly/react-core": "4.40.4",
"core-js": "3.6.5",
"react": "16.13.1",
From 0ec0856e0e93eb6e029390814d20d739b7ea312e Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Sun, 30 Aug 2020 15:49:49 +0000
Subject: [PATCH 124/942] package.json: Update @patternfly/react-core package
dependency
Closes #359
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 1e16b2e..589477d 100644
--- a/package.json
+++ b/package.json
@@ -48,7 +48,7 @@
},
"dependencies": {
"@patternfly/patternfly": "4.35.2",
- "@patternfly/react-core": "4.40.4",
+ "@patternfly/react-core": "4.47.0",
"core-js": "3.6.5",
"react": "16.13.1",
"react-dom": "16.13.1"
From 203604a463f900cfef0980a629ddfe9fb14c39ad Mon Sep 17 00:00:00 2001
From: Katerina Koukiou
Date: Mon, 24 Aug 2020 11:47:44 +0200
Subject: [PATCH 125/942] Copy patternfly import files from cockpit project
automatically
Closes #357
---
.gitignore | 1 +
.travis.yml | 3 +-
Makefile | 11 ++++++--
src/index.js | 4 +--
src/lib/_fonts.scss | 36 ------------------------
src/lib/patternfly-4-cockpit.scss | 14 ----------
src/lib/patternfly-4-overrides.scss | 43 -----------------------------
7 files changed, 13 insertions(+), 99 deletions(-)
delete mode 100644 src/lib/_fonts.scss
delete mode 100644 src/lib/patternfly-4-cockpit.scss
delete mode 100644 src/lib/patternfly-4-overrides.scss
diff --git a/.gitignore b/.gitignore
index 32b6401..b28fd69 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,5 +11,6 @@ Test*FAIL*
bots/
test/common/
test/images/
+src/lib/patternfly/
*.pot
POTFILES*
diff --git a/.travis.yml b/.travis.yml
index 2b45223..403be86 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -4,5 +4,4 @@ language: node_js
node_js:
- "8"
script:
- - npm install
- - npm run build
+ - make
diff --git a/Makefile b/Makefile
index 1325afa..ead3972 100644
--- a/Makefile
+++ b/Makefile
@@ -65,7 +65,7 @@ dist/po.%.js: po/%.po $(NODE_MODULES_TEST)
%.spec: %.spec.in
sed -e 's/%{VERSION}/$(VERSION)/g' $< > $@
-$(WEBPACK_TEST): $(NODE_MODULES_TEST) $(shell find src/ -type f) package.json webpack.config.js $(patsubst %,dist/po.%.js,$(LINGUAS))
+$(WEBPACK_TEST): $(NODE_MODULES_TEST) src/lib/patternfly/_fonts.scss $(shell find src/ -type f) package.json webpack.config.js $(patsubst %,dist/po.%.js,$(LINGUAS))
NODE_ENV=$(NODE_ENV) npm run build
watch:
@@ -100,7 +100,7 @@ $(TARFILE): $(WEBPACK_TEST) cockpit-$(PACKAGE_NAME).spec
touch dist/*
tar czf cockpit-$(PACKAGE_NAME)-$(VERSION).tar.gz --transform 's,^,cockpit-$(PACKAGE_NAME)/,' \
--exclude cockpit-$(PACKAGE_NAME).spec.in \
- $$(git ls-files) package-lock.json cockpit-$(PACKAGE_NAME).spec dist/
+ $$(git ls-files) src/lib/patternfly/*.scss package-lock.json cockpit-$(PACKAGE_NAME).spec dist/
mv node_modules.release node_modules
srpm: $(TARFILE) cockpit-$(PACKAGE_NAME).spec
@@ -157,6 +157,13 @@ test/common:
git checkout --force FETCH_HEAD -- test/common
git reset test/common
+src/lib/patternfly/_fonts.scss:
+ git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 227
+ mkdir -p pkg/lib/patternfly && git add pkg/lib/patternfly
+ git checkout --force FETCH_HEAD -- pkg/lib/patternfly
+ git restore --staged pkg/lib/patternfly
+ mkdir -p src/lib && mv pkg/lib/patternfly src/lib/patternfly && rmdir -p pkg/lib
+
$(NODE_MODULES_TEST): package.json
# if it exists already, npm install won't update it; force that so that we always get up-to-date packages
rm -f package-lock.json
diff --git a/src/index.js b/src/index.js
index 85fa0c4..b718ab6 100644
--- a/src/index.js
+++ b/src/index.js
@@ -17,7 +17,7 @@
* along with Cockpit; If not, see .
*/
-import "./lib/patternfly-4-cockpit.scss";
+import "./lib/patternfly/patternfly-4-cockpit.scss";
import "core-js/stable";
@@ -31,7 +31,7 @@ import { Application } from './app.jsx';
* out of the dist/index.js and since it will maintain the order of the imported CSS,
* the overrides will be correctly in the end of our stylesheet.
*/
-import "./lib/patternfly-4-overrides.scss";
+import "./lib/patternfly/patternfly-4-overrides.scss";
document.addEventListener("DOMContentLoaded", function () {
ReactDOM.render(React.createElement(Application, {}), document.getElementById('app'));
diff --git a/src/lib/_fonts.scss b/src/lib/_fonts.scss
deleted file mode 100644
index b3cb18a..0000000
--- a/src/lib/_fonts.scss
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Keep in sync with https://github.com/cockpit-project/cockpit/tree/master/src/base1/_fonts.scss
- */
-
-@mixin printRedHatFont(
-$weightValue: 400,
-$weightName: "Regular",
-$familyName: "RedHatText",
-$style: "normal",
-$relative: true
-) {
- $filePath: "../../static/fonts" + "/" + $familyName + "-" + $weightName;
- @font-face {
- font-family: $familyName;
- src: url('#{$filePath}.woff2') format('woff2');
- font-style: #{$style};
- font-weight: $weightValue;
- text-rendering: optimizeLegibility;
- }
-}
-
-@include printRedHatFont(700, "Bold", $familyName: "RedHatDisplay");
-@include printRedHatFont(700, "BoldItalic", $style: "italic", $familyName: "RedHatDisplay");
-@include printRedHatFont(300, "Black", $familyName: "RedHatDisplay");
-@include printRedHatFont(300, "BlackItalic", $style: "italic", $familyName: "RedHatDisplay");
-@include printRedHatFont(300, "Italic", $style: "italic", $familyName: "RedHatDisplay");
-@include printRedHatFont(400, "Medium", $familyName: "RedHatDisplay");
-@include printRedHatFont(400, "MediumItalic", $style: "italic", $familyName: "RedHatDisplay");
-@include printRedHatFont(300, "Regular", $familyName: "RedHatDisplay");
-
-@include printRedHatFont(300, "Bold");
-@include printRedHatFont(300, "BoldItalic", $style: "italic");
-@include printRedHatFont(300, "Italic");
-@include printRedHatFont(700, "Medium");
-@include printRedHatFont(700, "MediumItalic", $style: "italic");
-@include printRedHatFont(400, "Regular");
diff --git a/src/lib/patternfly-4-cockpit.scss b/src/lib/patternfly-4-cockpit.scss
deleted file mode 100644
index 40da84e..0000000
--- a/src/lib/patternfly-4-cockpit.scss
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * Keep in sync with https://github.com/cockpit-project/cockpit/tree/master/src/base1/patternfly-4-cockpit.scss
- */
-
-/* Set fake font and icon path variables - we are going to indentify these through
- * string replacement and remove the relevant font-face declarations
- */
-$pf-global--font-path: 'patternfly-fonts-fake-path';
-$pf-global--fonticon-path: 'patternfly-icons-fake-path';
-$pf-global--disable-fontawesome: true !default; // Disable Font Awesome 5 Free
-@import '@patternfly/patternfly/patternfly-base.scss';
-
-/* Import our own fonts since the PF4 font-face rules are filtered out with patternfly.sed */
-@import "./fonts";
diff --git a/src/lib/patternfly-4-overrides.scss b/src/lib/patternfly-4-overrides.scss
deleted file mode 100644
index a02cb95..0000000
--- a/src/lib/patternfly-4-overrides.scss
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Keep in sync with https://github.com/cockpit-project/cockpit/tree/master/pkg/lib/patternfly-4-overrides.scss
- */
-
-/*** PF4 overrides ***/
-
-/* WORKAROUND: Override word-break bug */
-/* See: https://github.com/patternfly/patternfly-next/issues/2325 */
-.pf-c-table td {
- word-break: normal;
- overflow-wrap: break-word;
-}
-
-/* WORKAROUND: Dropdown (PF4): Caret is not properly aligned bug */
-/* See: https://github.com/patternfly/patternfly/issues/2715 */
-/* Align the icons inside of all dropdown toggles. */
-/* Part 1 of 2 */
-.pf-c-dropdown__toggle-button {
- display: flex;
- align-items: center;
-}
-
-/* Make split button dropdowns the same height as their sibling. */
-/* Part 2 of 2 */
-.pf-m-split-button {
- align-items: stretch;
-}
-
-/* WORKAROUND: Navigation problems with Tertiary Nav widget on mobile */
-/* See: https://github.com/patternfly/patternfly-design/issues/840 */
-/* Helper mod to wrap pf-c-nav__tertiary */
-.ct-m-nav__tertiary-wrap {
- flex-wrap: wrap;
-
- .pf-c-nav__scroll-button {
- display: none;
- }
-}
-
-/* Helper mod to center pf-c-nav__tertiary when it wraps */
-.ct-m-nav__tertiary-center {
- justify-content: center;
-}
From cfced1900069ed816abd253938508c29e729b47d Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Mon, 7 Sep 2020 14:36:21 +0200
Subject: [PATCH 126/942] Makefile: Serialize git cloning targets
The `bots`, `test/common`, and `src/lib/patternfly` targets cannot be
run in parallel, as they compete for the git lock.
Serialize them by adding arbitrary dependencies to them.
---
Makefile | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Makefile b/Makefile
index ead3972..e28e42e 100644
--- a/Makefile
+++ b/Makefile
@@ -164,6 +164,10 @@ src/lib/patternfly/_fonts.scss:
git restore --staged pkg/lib/patternfly
mkdir -p src/lib && mv pkg/lib/patternfly src/lib/patternfly && rmdir -p pkg/lib
+# force serialization of the targets that call git, as they compete for the git lock
+bots: test/common
+test/common: src/lib/patternfly/_fonts.scss
+
$(NODE_MODULES_TEST): package.json
# if it exists already, npm install won't update it; force that so that we always get up-to-date packages
rm -f package-lock.json
From 080b20af94b10887f946d9bc98cd64f890bd02b1 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Tue, 8 Sep 2020 18:53:12 +0200
Subject: [PATCH 127/942] Ensure application CSS has priority over library CSS
Import our application CSS as the very last thing, so that it can
properly override PatternFly variables. Before, our application CSS
could land in the first third of dist/index.css *before* PatternFly's
definitions, so that the latter overrode the former [1].
This is a long-standing bug in mini-css-extract-plugin ([2] and
countless things that point to it) with `NODE_ENV=production` builds.
As a workaround, make sure that app.scss is the absolutely last imported
CSS, instead of "almost last". It is still conceptually correct for the
application CSS to be able to override patternfly-4-overrides.scss.
Closes #362
[1] https://github.com/martinpitt/performance-graphs/issues/10
[2] https://github.com/webpack-contrib/mini-css-extract-plugin/issues/188
---
src/app.jsx | 1 -
src/index.js | 1 +
2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/app.jsx b/src/app.jsx
index fd9d3df..c88d25e 100644
--- a/src/app.jsx
+++ b/src/app.jsx
@@ -20,7 +20,6 @@
import cockpit from 'cockpit';
import React from 'react';
import { Alert, Card, CardTitle, CardBody } from '@patternfly/react-core';
-import './app.scss';
const _ = cockpit.gettext;
diff --git a/src/index.js b/src/index.js
index b718ab6..11a1c9c 100644
--- a/src/index.js
+++ b/src/index.js
@@ -32,6 +32,7 @@ import { Application } from './app.jsx';
* the overrides will be correctly in the end of our stylesheet.
*/
import "./lib/patternfly/patternfly-4-overrides.scss";
+import './app.scss';
document.addEventListener("DOMContentLoaded", function () {
ReactDOM.render(React.createElement(Application, {}), document.getElementById('app'));
From d7f9b03f3afbd279479a0ee324d2a3b16d5a3577 Mon Sep 17 00:00:00 2001
From: Matej Marusak
Date: Mon, 21 Sep 2020 12:19:25 +0200
Subject: [PATCH 128/942] test: Bump test/common to 228
On the login page the `Reuse password` checkbox was dropped and that
makes all the tests to fail.
See https://github.com/cockpit-project/cockpit/commit/ef97e7e9a28a
Closes #366
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index e28e42e..48f60b2 100644
--- a/Makefile
+++ b/Makefile
@@ -153,7 +153,7 @@ bots:
# checkout Cockpit's test API; this has no API stability guarantee, so check out a stable tag
# when you start a new project, use the latest release, and update it from time to time
test/common:
- git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 224
+ git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 228
git checkout --force FETCH_HEAD -- test/common
git reset test/common
From 0a47c6f034cb81b71c441a44ec4a92d1343b5853 Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Mon, 21 Sep 2020 07:14:27 +0000
Subject: [PATCH 129/942] package.json: Update @patternfly/react-core package
dependency
Closes #368
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 589477d..c28ff62 100644
--- a/package.json
+++ b/package.json
@@ -48,7 +48,7 @@
},
"dependencies": {
"@patternfly/patternfly": "4.35.2",
- "@patternfly/react-core": "4.47.0",
+ "@patternfly/react-core": "4.50.2",
"core-js": "3.6.5",
"react": "16.13.1",
"react-dom": "16.13.1"
From 661ca771b384e2a6e8685d99b2dba8c85a3e698f Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Tue, 22 Sep 2020 07:51:54 +0200
Subject: [PATCH 130/942] Makefile: Replace `git restore` command
This is a relatively recent git feature which is not present in e.g.
Debian 9 yet. Use `git reset` instead, like in the test/common rule.
Fixes #369
Closes #370
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 48f60b2..47c2ec7 100644
--- a/Makefile
+++ b/Makefile
@@ -161,7 +161,7 @@ src/lib/patternfly/_fonts.scss:
git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 227
mkdir -p pkg/lib/patternfly && git add pkg/lib/patternfly
git checkout --force FETCH_HEAD -- pkg/lib/patternfly
- git restore --staged pkg/lib/patternfly
+ git reset -- pkg/lib/patternfly
mkdir -p src/lib && mv pkg/lib/patternfly src/lib/patternfly && rmdir -p pkg/lib
# force serialization of the targets that call git, as they compete for the git lock
From 6bd2f3ed94f86b3e5459947178bddbeb9473b263 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Mon, 21 Sep 2020 12:55:35 +0200
Subject: [PATCH 131/942] Makefile: Serialize git commands using flock
We previously made directories depend on files for the synthetic
serialization of git commands. git does not track directories, and
time stamps across repos (starter-kit vs. bots) work rather poorly --
for example, this broke "bots" being a symlink to a previously existing
checkout.
Use file locking instead, which is a more direct way of ensuring that
there is only one git operation that affects the current checkout. We
don't need to flock bots/, as that's an independent git repository.
Closes #371
---
Makefile | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)
diff --git a/Makefile b/Makefile
index 47c2ec7..e81978a 100644
--- a/Makefile
+++ b/Makefile
@@ -153,21 +153,19 @@ bots:
# checkout Cockpit's test API; this has no API stability guarantee, so check out a stable tag
# when you start a new project, use the latest release, and update it from time to time
test/common:
- git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 228
- git checkout --force FETCH_HEAD -- test/common
- git reset test/common
+ flock Makefile sh -ec '\
+ git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 228; \
+ git checkout --force FETCH_HEAD -- test/common; \
+ git reset test/common'
src/lib/patternfly/_fonts.scss:
- git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 227
- mkdir -p pkg/lib/patternfly && git add pkg/lib/patternfly
- git checkout --force FETCH_HEAD -- pkg/lib/patternfly
- git reset -- pkg/lib/patternfly
+ flock Makefile sh -ec '\
+ git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 227; \
+ mkdir -p pkg/lib/patternfly && git add pkg/lib/patternfly; \
+ git checkout --force FETCH_HEAD -- pkg/lib/patternfly; \
+ git reset -- pkg/lib/patternfly'
mkdir -p src/lib && mv pkg/lib/patternfly src/lib/patternfly && rmdir -p pkg/lib
-# force serialization of the targets that call git, as they compete for the git lock
-bots: test/common
-test/common: src/lib/patternfly/_fonts.scss
-
$(NODE_MODULES_TEST): package.json
# if it exists already, npm install won't update it; force that so that we always get up-to-date packages
rm -f package-lock.json
From 44b94eb59d85a82be8a8a13e5e2b77008f9a0958 Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Thu, 24 Sep 2020 10:52:27 +0000
Subject: [PATCH 132/942] package.json: Update @patternfly/patternfly package
dependency
Closes #372
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index c28ff62..ccb987c 100644
--- a/package.json
+++ b/package.json
@@ -47,7 +47,7 @@
"webpack-cli": "^3.3.5"
},
"dependencies": {
- "@patternfly/patternfly": "4.35.2",
+ "@patternfly/patternfly": "4.42.2",
"@patternfly/react-core": "4.50.2",
"core-js": "3.6.5",
"react": "16.13.1",
From e4dc9d71184f283baa0041c7898485874013637a Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Mon, 28 Sep 2020 07:35:03 +0200
Subject: [PATCH 133/942] travis: Move to current LTS node.js
Version 8 is ancient and not supported any more, see
https://docs.travis-ci.com/user/languages/javascript-with-nodejs/
Newer versions of copy-webpack-plugin don't work any more with 8.
---
.travis.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.travis.yml b/.travis.yml
index 403be86..97c7f91 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -2,6 +2,6 @@ dist: bionic
sudo: false
language: node_js
node_js:
- - "8"
+ - "lts/*"
script:
- make
From a5ade152a811a48fec6af2b0a003757f7c36707b Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Mon, 28 Sep 2020 06:54:59 +0200
Subject: [PATCH 134/942] npm: Upgrade webpack related development dependencies
compression-webpack-plugin fixes https://www.npmjs.com/advisories/1548
Adjust to new copy-webpack-plugin API.
Thew new modules now create dist/index.html.gz in `NODE_ENV=production`
mode, so switch `WEBPACK_TEST` to index.css instead (which remains
uncompressed in both modes).
---
Makefile | 2 +-
package.json | 12 ++++++------
webpack.config.js | 2 +-
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/Makefile b/Makefile
index e81978a..813e9d6 100644
--- a/Makefile
+++ b/Makefile
@@ -11,7 +11,7 @@ VM_IMAGE=$(CURDIR)/test/images/$(TEST_OS)
# stamp file to check if/when npm install ran
NODE_MODULES_TEST=package-lock.json
# one example file in dist/ from webpack to check if that already ran
-WEBPACK_TEST=dist/index.html
+WEBPACK_TEST=dist/index.css
all: $(WEBPACK_TEST)
diff --git a/package.json b/package.json
index ccb987c..3188d64 100644
--- a/package.json
+++ b/package.json
@@ -19,9 +19,9 @@
"babel-eslint": "^10.0.3",
"babel-loader": "^8.0.6",
"chrome-remote-interface": "^0.28.0",
- "compression-webpack-plugin": "^3.0.0",
- "copy-webpack-plugin": "^5.0.3",
- "css-loader": "^3.0.0",
+ "compression-webpack-plugin": "^6.0.0",
+ "copy-webpack-plugin": "^6.1.0",
+ "css-loader": "^4.3.0",
"eslint": "^6.3.0",
"eslint-config-standard": "^14.1.0",
"eslint-config-standard-react": "^9.2.0",
@@ -35,13 +35,13 @@
"eslint-plugin-standard": "^4.0.1",
"htmlparser": "^1.7.7",
"jed": "^1.1.1",
- "mini-css-extract-plugin": "^0.9.0",
+ "mini-css-extract-plugin": "^0.11.0",
"node-sass": "^4.14.1",
"po2json": "^1.0.0-alpha",
"qunit": "^2.9.3",
- "sass-loader": "^8.0.2",
+ "sass-loader": "^10.0.2",
"sizzle": "^2.3.3",
- "stdio": "^0.2.7",
+ "stdio": "^2.1.0",
"string-replace-loader": "^2.3.0",
"webpack": "^4.35.3",
"webpack-cli": "^3.3.5"
diff --git a/webpack.config.js b/webpack.config.js
index 9929619..a0d9904 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -78,7 +78,7 @@ info.files.forEach(function(value) {
info.files = files;
var plugins = [
- new copy(info.files),
+ new copy({ patterns: info.files }),
new extract({filename: "[name].css"})
];
From 8f93db2234763a2d7ed2d5beaab56ff5b8ed8a69 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Mon, 28 Sep 2020 07:09:40 +0200
Subject: [PATCH 135/942] npm: Upgrade eslint to current major versions
Closes #373
---
package.json | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/package.json b/package.json
index 3188d64..29a11a6 100644
--- a/package.json
+++ b/package.json
@@ -22,16 +22,16 @@
"compression-webpack-plugin": "^6.0.0",
"copy-webpack-plugin": "^6.1.0",
"css-loader": "^4.3.0",
- "eslint": "^6.3.0",
- "eslint-config-standard": "^14.1.0",
+ "eslint": "^7.10.0",
+ "eslint-config-standard": "^14.1.1",
"eslint-config-standard-react": "^9.2.0",
- "eslint-loader": "^3.0.0",
- "eslint-plugin-flowtype": "^4.3.0",
- "eslint-plugin-import": "^2.18.2",
- "eslint-plugin-node": "^10.0.0",
+ "eslint-loader": "^4.0.2",
+ "eslint-plugin-flowtype": "^5.2.0",
+ "eslint-plugin-import": "^2.22.1",
+ "eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
- "eslint-plugin-react": "^7.16.0",
- "eslint-plugin-react-hooks": "^2.1.2",
+ "eslint-plugin-react": "^7.21.2",
+ "eslint-plugin-react-hooks": "^4.1.2",
"eslint-plugin-standard": "^4.0.1",
"htmlparser": "^1.7.7",
"jed": "^1.1.1",
From 6f8cd78783614a1182347fd08512eca5a3329fc9 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Tue, 29 Sep 2020 11:46:41 +0200
Subject: [PATCH 136/942] Use standard "translate" marker in HTML
Cockpit's test-static-code complains about `translatable`, so let's use
the correct attribute to avoid spreading it further.
---
src/index.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/index.html b/src/index.html
index 62a2bf0..40e2687 100644
--- a/src/index.html
+++ b/src/index.html
@@ -17,7 +17,7 @@ along with this package; If not, see .
-->
- Cockpit Starter Kit
+ Cockpit Starter Kit
From cbedf06704c162b590365ee814636ead69bffb90 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Tue, 29 Sep 2020 12:04:13 +0200
Subject: [PATCH 137/942] Fix building PO template
The current version failed with
Option "--directory" requires 1 arguments, but 0 were provided
In the current stdio npm module version, getopt() now requires a
`default:` attribute, otherwise it considers the options as required.
Also sync PO helpers with current cockpit.
Add PO template build to travis check, to make sure that it keeps
working.
Closes #375
---
.travis.yml | 1 +
po/html2po | 4 ++--
po/manifest2po | 16 ++++++++++++----
po/po2json | 8 ++++----
4 files changed, 19 insertions(+), 10 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 97c7f91..db62cff 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,3 +5,4 @@ node_js:
- "lts/*"
script:
- make
+ - make po/starter-kit.pot
diff --git a/po/html2po b/po/html2po
index 2c92897..8b34fa0 100755
--- a/po/html2po
+++ b/po/html2po
@@ -45,9 +45,9 @@ try {
}
var opts = stdio.getopt({
- directory: { key: "d", args: 1, description: "Base directory for input files" },
+ directory: { key: "d", args: 1, description: "Base directory for input files", default: "." },
output: { key: "o", args: 1, description: "Output file" },
- from: { key: "f", args: 1, description: "File containing list of input files" },
+ from: { key: "f", args: 1, description: "File containing list of input files", default: "" },
});
if (!opts.from && opts.args.length < 1) {
diff --git a/po/manifest2po b/po/manifest2po
index 5376ef8..9fc9ee5 100755
--- a/po/manifest2po
+++ b/po/manifest2po
@@ -26,9 +26,9 @@ try {
}
var opts = stdio.getopt({
- directory: { key: "d", args: 1, description: "Base directory for input files" },
+ directory: { key: "d", args: 1, description: "Base directory for input files", default: "." },
output: { key: "o", args: 1, description: "Output file" },
- from: { key: "f", args: 1, description: "File containing list of input files" },
+ from: { key: "f", args: 1, description: "File containing list of input files", default: "" },
});
if (!opts.from && opts.args.length < 1) {
@@ -70,11 +70,19 @@ function step() {
if (path.basename(filename) != "manifest.json")
return step();
- fs.readFile(filename, { encoding: "utf-8"}, function(err, data) {
+ /* Qualify the filename if necessary */
+ var full = filename;
+ if (opts.directory)
+ full = path.join(opts.directory, filename);
+
+ fs.readFile(full, { encoding: "utf-8"}, function(err, data) {
if (err)
fatal(err.message);
- process_manifest(JSON.parse(data));
+ // There are variables which when not substituted can cause JSON.parse to fail
+ // Dummy replace them. None variable is going to be translated anyway
+ safe_data = data.replace(/\@.+?\@/gi, 1);
+ process_manifest(JSON.parse(safe_data));
return step();
});
diff --git a/po/po2json b/po/po2json
index d2185a4..67cedde 100755
--- a/po/po2json
+++ b/po/po2json
@@ -46,10 +46,10 @@ function prepareHeader(header) {
}
/* A function for the front end */
- statement = header["plural-forms"];
+ statement = header["plural-forms"];
if (statement[statement.length - 1] != ';')
statement += ';';
- ret = 'function(n) {\nvar nplurals, plural;\n' + statement + '\nreturn plural;\n}';
+ ret = 'function(n) {\nvar nplurals, plural;\n' + statement + '\nreturn plural;\n}';
/* Added back in later */
delete header["plural-forms"];
@@ -72,7 +72,7 @@ function prepareHeader(header) {
/* Parse and process the po data */
function parse() {
filename = opts.args[0];
- po2json.parseFile(opts.args[0], { "fuzzy": true }, function(err, jsonData) {
+ po2json.parseFile(opts.args[0], { "fuzzy": false }, function(err, jsonData) {
var plurals, pos;
if (err)
@@ -117,7 +117,7 @@ function finish(data) {
if (opts.output) {
fs.writeFile(opts.output, data, function(err) {
if (err)
- fatal(err.message);
+ fatal(err.message);
process.exit(0);
});
} else {
From 499eca014beaa5bfe519503c94ea4bdb66273c70 Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Wed, 7 Oct 2020 11:53:33 +0000
Subject: [PATCH 138/942] package.json: Update @patternfly/react-core package
dependency
Closes #378
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 29a11a6..e6ed79d 100644
--- a/package.json
+++ b/package.json
@@ -48,7 +48,7 @@
},
"dependencies": {
"@patternfly/patternfly": "4.42.2",
- "@patternfly/react-core": "4.50.2",
+ "@patternfly/react-core": "4.63.3",
"core-js": "3.6.5",
"react": "16.13.1",
"react-dom": "16.13.1"
From 2a51e057d771d4ad5944532472a9da3c7cc09ae9 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Tue, 13 Oct 2020 08:04:37 +0200
Subject: [PATCH 139/942] Show how to run the release in GitHub workflow
Enter the new world of GitHub actions [1]/GitLab pipelines [2]. This
simplifies our end of the infrastructure considerably:
* No need any more to set up webhooks, all the relevant configuration
is right in the workflow file.
* Does not need any infrastructure on our side any more, and thus works
for third-party projects. They just need to set up their own secrets.
* GitHub automatically provides a temporary `GITHUB_TOKEN` with
sufficient write access to the project to publish a release, so we
don't need to carry around that secret. Thus if your project only
releases to GitHub, there is zero secrets management.
Also adjust cockpituous-release a bit (update Fedora version, fix
project name copy-pasta), point to the action workflow and necessary
secrets.
Closes #380
---
.github/workflows/release.yml.disabled | 35 ++++++++++++++++++++++++++
README.md | 10 ++++----
cockpituous-release | 20 +++++++++------
3 files changed, 53 insertions(+), 12 deletions(-)
create mode 100644 .github/workflows/release.yml.disabled
diff --git a/.github/workflows/release.yml.disabled b/.github/workflows/release.yml.disabled
new file mode 100644
index 0000000..e2249d0
--- /dev/null
+++ b/.github/workflows/release.yml.disabled
@@ -0,0 +1,35 @@
+name: release
+on:
+ push:
+ tags:
+ # this is a glob, not a regexp
+ - '[0-9]*'
+jobs:
+ cockpituous:
+ runs-on: ubuntu-latest
+ container:
+ image: docker.io/cockpit/release
+ steps:
+ - name: Set up configuration and secrets
+ run: |
+ # override GitHub's bind mount from host, we don't want anything from there and it interferes with ssh
+ export HOME=$(getent passwd $(id -u) | cut -f6 -d:)
+
+ # secrets come from https://github.com/organizations/ORGNAME/settings/secrets or https://github.com/OWNER/REPO/settings/secrets
+ # see https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets
+ echo '${{ secrets.SSH_KNOWN_HOSTS }}' > ~/.ssh/known_hosts
+ echo '${{ secrets.FEDPKG_SSH_PUBLIC }}' > ~/.ssh/id_rsa.pub
+ echo '${{ secrets.FEDPKG_SSH_PRIVATE }}' > ~/.ssh/id_rsa
+ chmod 600 ~/.ssh/id_rsa
+ # FIXME: Set your Fedora user account name here
+ echo 'yourfedorauser' > ~/.config/bodhi-user
+ echo '${{ secrets.GITHUB_TOKEN }}' > ~/.config/github-token
+ echo '${{ secrets.COPR_TOKEN }}' > ~/.config/copr
+ echo '${{ secrets.FEDORA_PASSWORD }}' > ~/.fedora-password
+
+ - name: Run cockpituous
+ run: |
+ # override GitHub's bind mount from host, we don't want anything from there and it interferes with ssh
+ export HOME=$(getent passwd $(id -u) | cut -f6 -d:)
+ cd /build
+ release-runner -r https://github.com/$GITHUB_REPOSITORY -t $(basename $GITHUB_REF) ./cockpituous-release
diff --git a/README.md b/README.md
index ceff4cc..aa94315 100644
--- a/README.md
+++ b/README.md
@@ -96,12 +96,12 @@ that. [Cockpituous release](https://github.com/cockpit-project/cockpituous/tree
aims to fully automate project releases to GitHub, Fedora, Ubuntu, COPR, Docker
Hub, and other places. The intention is that the only manual step for releasing
a project is to create a signed tag for the version number; pushing the tag
-then triggers a GitHub webhook that calls a set of release scripts (on
-Cockpit's CI infrastructure).
+then triggers a [GitHub action](https://github.com/features/actions) that calls a set of release scripts.
-starter-kit includes an example [cockpitous release script](./cockpituous-release)
-that builds an upstream release tarball and source RPM. Please see the above
-cockpituous documentation for details.
+starter-kit includes an example [cockpitous release script](./cockpituous-release),
+with detailed comments how to use it. There is also an
+[example GitHub release action](.github/workflows/release.yml.disabled) to set
+up secrets and run cockpituous.
# Further reading
diff --git a/cockpituous-release b/cockpituous-release
index 19bcb99..f53ec27 100644
--- a/cockpituous-release
+++ b/cockpituous-release
@@ -1,4 +1,4 @@
-# This is a script run to release welder-web through Cockpituous:
+# This is a script run to release this project through Cockpituous:
# https://github.com/cockpit-project/cockpituous/tree/master/release
# Anything that start with 'job' may run in a way that it SIGSTOP's
@@ -6,6 +6,9 @@
# order to complete its work.
#
# Check cockpituous documentation for available release targets.
+#
+# This gets run through a GitHub action: enable and adjust
+# .github/workflows/release.yml.disabled once you are ready.
RELEASE_SOURCE="_release/source"
RELEASE_SPEC="cockpit-starter-kit.spec"
@@ -14,18 +17,21 @@ RELEASE_SRPM="_release/srpm"
job release-source
job release-srpm -V
-# Once you have a Fedora package and add the https://pagure.io/user/cockpit
-# user to your project's maintainers, you can also upload to Fedora automatically:
+# Once you have a Fedora package, can upload to Fedora automatically: Provide the
+# secrets in .github/workflows/release.yml on GitHub, and enable the following:
-## Authenticate for pushing into Fedora dist-git (works in Cockpituous release container)
-# cat ~/.fedora-password | kinit cockpit@FEDORAPROJECT.ORG
+## Authenticate for pushing into Fedora dist-git
+# cat ~/.fedora-password | kinit yourfedorauser@FEDORAPROJECT.ORG
## Do fedora builds for the tag, using tarball
# job release-koji -k master
-# job release-koji f29
-# job release-bodhi F29
+# job release-koji f33
+# job release-bodhi F33
# These are likely the first of your release targets; but run them after Fedora uploads,
# so that failures there will fail the release early, before publishing on GitHub
+# this needs no explicit secrets, just the GitHub action provided default one
# job release-github
+
+# This needs secrets.COPR_TOKEN in .github/workflows/release.yml
# job release-copr @myorg/myrepo
From b6a10e5cfecf95a849ded2aeb7b0ba4d5ed3f5ea Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Mon, 12 Oct 2020 21:40:28 +0000
Subject: [PATCH 140/942] package.json: Update @patternfly/patternfly package
dependency
Closes #379
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index e6ed79d..1b12514 100644
--- a/package.json
+++ b/package.json
@@ -47,7 +47,7 @@
"webpack-cli": "^3.3.5"
},
"dependencies": {
- "@patternfly/patternfly": "4.42.2",
+ "@patternfly/patternfly": "4.50.4",
"@patternfly/react-core": "4.63.3",
"core-js": "3.6.5",
"react": "16.13.1",
From 7838cb70a9f3360e28490237707f3d32e5156c1a Mon Sep 17 00:00:00 2001
From: Cockpit Bots
Date: Fri, 16 Oct 2020 22:07:15 +0200
Subject: [PATCH 141/942] package.json: Update react package dependency (#381)
Closes #381
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 1b12514..94e6947 100644
--- a/package.json
+++ b/package.json
@@ -50,7 +50,7 @@
"@patternfly/patternfly": "4.50.4",
"@patternfly/react-core": "4.63.3",
"core-js": "3.6.5",
- "react": "16.13.1",
+ "react": "16.14.0",
"react-dom": "16.13.1"
}
}
From 8e16b06df2463cf4fe01aa931a680bf9bf2d18c2 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Tue, 20 Oct 2020 09:08:08 +0200
Subject: [PATCH 142/942] Run npm-update in a GitHub workflow
This avoids a lot of moving parts in our infrastructure (webhook,
npm-trigger roundtrip, tasks container), works in exactly the same way
for independent third-party projects, and does not need *any* secret
other than the automatically provided GitHub token.
Let this run early every morning, roughly similar frequency as
cockpituous used to do. Also add a manual trigger, so that we get a
button to run it on demand.
Closes #384
---
.github/workflows/npm-update.yml | 25 +++++++++++++++++++++++++
.tasks | 13 -------------
README.md | 8 ++++++++
3 files changed, 33 insertions(+), 13 deletions(-)
create mode 100644 .github/workflows/npm-update.yml
delete mode 100755 .tasks
diff --git a/.github/workflows/npm-update.yml b/.github/workflows/npm-update.yml
new file mode 100644
index 0000000..446e4df
--- /dev/null
+++ b/.github/workflows/npm-update.yml
@@ -0,0 +1,25 @@
+name: npm-update
+on:
+ schedule:
+ - cron: '0 2 * * *'
+ # can be run manually on https://github.com/cockpit-project/starter-kit/actions
+ workflow_dispatch:
+jobs:
+ npm-update:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Set up dependencies
+ run: sudo apt-get install -y npm make
+
+ - name: Set up configuration and secrets
+ run: |
+ printf '[user]\n\tname = Cockpit Project\n\temail=cockpituous@gmail.com\n' > ~/.gitconfig
+ echo '${{ secrets.GITHUB_TOKEN }}' > ~/.config/github-token
+
+ - name: Clone repository
+ uses: actions/checkout@v2
+
+ - name: Run npm-update bot
+ run: |
+ make bots
+ bots/npm-update
diff --git a/.tasks b/.tasks
deleted file mode 100755
index 2026460..0000000
--- a/.tasks
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/sh
-
-# When run automated, randomize to minimize stampeding herd
-if [ -t 0 ]; then
- chance=10
-else
- chance=$(shuf -i 0-10 -n 1)
-fi
-
-if [ $chance -gt 9 ]; then
- # Open issues for things that need doing on a regular basis
- bots/npm-trigger
-fi
diff --git a/README.md b/README.md
index aa94315..1a4e6a2 100644
--- a/README.md
+++ b/README.md
@@ -103,6 +103,14 @@ with detailed comments how to use it. There is also an
[example GitHub release action](.github/workflows/release.yml.disabled) to set
up secrets and run cockpituous.
+# Automated maintenance
+
+It is important to keep your [NPM modules](./package.json) up to date, to keep
+up with security updates and bug fixes. This is done with the
+[npm-update bot script](https://github.com/cockpit-project/bots/blob/master/npm-update)
+which is run weekly or upon [manual request](https://github.com/cockpit-project/starter-kit/actions) through the
+[npm-update.yml](.github/workflows/npm-update.yml) [GitHub action](https://github.com/features/actions).
+
# Further reading
* The [Starter Kit announcement](http://cockpit-project.org/blog/cockpit-starter-kit.html)
From 29fb8b5c9844f0fd8b6ff149355c843ca3951434 Mon Sep 17 00:00:00 2001
From: Cockpituous
Date: Mon, 19 Oct 2020 22:06:45 +0000
Subject: [PATCH 143/942] package.json: Update react-dom package dependency
Closes #383
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 94e6947..e6fafc9 100644
--- a/package.json
+++ b/package.json
@@ -51,6 +51,6 @@
"@patternfly/react-core": "4.63.3",
"core-js": "3.6.5",
"react": "16.14.0",
- "react-dom": "16.13.1"
+ "react-dom": "16.14.0"
}
}
From 3703120a2338314820e5824e7e4cd676937028e8 Mon Sep 17 00:00:00 2001
From: Sanne Raymaekers
Date: Wed, 28 Oct 2020 10:15:32 +0100
Subject: [PATCH 144/942] Makefile: Bump test/common to 230
Closes #385
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 813e9d6..a19c08e 100644
--- a/Makefile
+++ b/Makefile
@@ -154,7 +154,7 @@ bots:
# when you start a new project, use the latest release, and update it from time to time
test/common:
flock Makefile sh -ec '\
- git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 228; \
+ git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 230; \
git checkout --force FETCH_HEAD -- test/common; \
git reset test/common'
From ea1377da1c9b6dd0b43216fd7339769889ace3eb Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Sat, 17 Oct 2020 12:03:13 +0200
Subject: [PATCH 145/942] Travis: Move to Ubuntu 20.04 LTS
---
.travis.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.travis.yml b/.travis.yml
index db62cff..ef8d75c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,4 +1,4 @@
-dist: bionic
+dist: focal
sudo: false
language: node_js
node_js:
From 233b5cfe04142fb33d0f0c54b05206a85108ba7c Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Sat, 17 Oct 2020 11:33:52 +0200
Subject: [PATCH 146/942] Use sassc instead of node-sass
node-sass is a compiled ELF module, which is problematic for
distributions that want to rebuild everything from source. The sassc CLI
program is packaged everywhere, and both use the same libsass library.
So drop node-sass and sass-loader, and replace it with a simple loader
wrapper around sassc.
This also saves 122 npm packages (16 MB in node_modules/).
Closes #382
---
.travis.yml | 4 ++++
package.json | 2 --
src/lib/sassc-loader.js | 25 +++++++++++++++++++++++++
webpack.config.js | 23 +++++------------------
4 files changed, 34 insertions(+), 20 deletions(-)
create mode 100644 src/lib/sassc-loader.js
diff --git a/.travis.yml b/.travis.yml
index ef8d75c..bee776c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -3,6 +3,10 @@ sudo: false
language: node_js
node_js:
- "lts/*"
+addons:
+ apt:
+ packages:
+ - sassc
script:
- make
- make po/starter-kit.pot
diff --git a/package.json b/package.json
index e6fafc9..b197446 100644
--- a/package.json
+++ b/package.json
@@ -36,10 +36,8 @@
"htmlparser": "^1.7.7",
"jed": "^1.1.1",
"mini-css-extract-plugin": "^0.11.0",
- "node-sass": "^4.14.1",
"po2json": "^1.0.0-alpha",
"qunit": "^2.9.3",
- "sass-loader": "^10.0.2",
"sizzle": "^2.3.3",
"stdio": "^2.1.0",
"string-replace-loader": "^2.3.0",
diff --git a/src/lib/sassc-loader.js b/src/lib/sassc-loader.js
new file mode 100644
index 0000000..19ff806
--- /dev/null
+++ b/src/lib/sassc-loader.js
@@ -0,0 +1,25 @@
+const fs = require('fs');
+const path = require('path');
+const childProcess = require('child_process');
+
+/* source is not used. This must be the first loader in the chain, using this.resource, so that sassc can include the scss file's directory in the include path */
+module.exports = function() {
+ this.cacheable();
+
+ const workdir = fs.mkdtempSync("sassc-loader.");
+ const out = path.join(workdir, "output.css");
+
+ childProcess.execFileSync(
+ 'sassc',
+ ['--load-path=node_modules', '--style=compressed', '--sourcemap', this.resource, out],
+ { stdio: ['pipe', 'stdio', 'stdio'] });
+
+ const css = fs.readFileSync(out, 'utf8');
+ const cssmap = fs.readFileSync(out + ".map", 'utf8');
+
+ fs.unlinkSync(out);
+ fs.unlinkSync(out + ".map");
+ fs.rmdirSync(workdir);
+
+ this.callback(null, css, cssmap);
+};
diff --git a/webpack.config.js b/webpack.config.js
index a0d9904..386ea37 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -118,6 +118,9 @@ module.exports = {
resolve: {
modules: [ nodedir ],
},
+ resolveLoader: {
+ modules: [ nodedir, path.resolve(__dirname, 'src/lib') ],
+ },
watchOptions: {
ignored: /node_modules/,
},
@@ -165,15 +168,7 @@ module.exports = {
]
},
},
- {
- loader: 'sass-loader',
- options: {
- sassOptions: {
- outputStyle: 'compressed',
- },
- sourceMap: true,
- },
- },
+ 'sassc-loader',
]
},
{
@@ -188,15 +183,7 @@ module.exports = {
url: false
}
},
- {
- loader: 'sass-loader',
- options: {
- sassOptions: {
- outputStyle: 'compressed',
- },
- sourceMap: true,
- },
- },
+ 'sassc-loader',
]
},
]
From fcab1935972cd99256438295a6f43762bf57397e Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Wed, 28 Oct 2020 02:30:09 +0000
Subject: [PATCH 147/942] package.json: Update @patternfly/patternfly package
dependency
Closes #387
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index b197446..df79c5b 100644
--- a/package.json
+++ b/package.json
@@ -45,7 +45,7 @@
"webpack-cli": "^3.3.5"
},
"dependencies": {
- "@patternfly/patternfly": "4.50.4",
+ "@patternfly/patternfly": "4.59.1",
"@patternfly/react-core": "4.63.3",
"core-js": "3.6.5",
"react": "16.14.0",
From 180dde395e1e55832c401484285611bd121d4608 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Tue, 27 Oct 2020 06:10:07 +0100
Subject: [PATCH 148/942] Makefile: Fix PO template generation dependencies
*2po tools need the npm modules installed.
---
Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index a19c08e..5f9e22b 100644
--- a/Makefile
+++ b/Makefile
@@ -38,10 +38,10 @@ po/POTFILES.html.in:
mkdir -p $(dir $@)
find src -name '*.html' > $@
-po/$(PACKAGE_NAME).html.pot: po/POTFILES.html.in
+po/$(PACKAGE_NAME).html.pot: po/POTFILES.html.in $(NODE_MODULES_TEST)
po/html2po -f $^ -o $@
-po/$(PACKAGE_NAME).manifest.pot:
+po/$(PACKAGE_NAME).manifest.pot: $(NODE_MODULES_TEST)
po/manifest2po src/manifest.json -o $@
po/$(PACKAGE_NAME).pot: po/$(PACKAGE_NAME).html.pot po/$(PACKAGE_NAME).js.pot po/$(PACKAGE_NAME).manifest.pot
From 0ea06f92357da0794c89d085b5331ab2f1ce7364 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Mon, 26 Oct 2020 13:43:53 +0100
Subject: [PATCH 149/942] Run integration tests in Travis
Travis now offers /dev/kvm, and its machines are powerful enough to run
our browser integration tests, at least for small projects.
Building an RPM on the Ubuntu host environment is a bit tricky, as there
are no installed RPMs. Thus ignore the BuildRequires, and install
appstream-util explicitly. In the future, the rpm/deb build should
happen inside the VM (like Cockpit does).
Add two scenarios for current Fedora and CentOS 8.
Switch to the "minimal" environment to make the test easier to reproduce
locally and more explicit.
Closes #386
---
.travis.yml | 29 ++++++++++++++++++++++++-----
README.md | 7 +++++++
2 files changed, 31 insertions(+), 5 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index bee776c..3527496 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,12 +1,31 @@
dist: focal
-sudo: false
-language: node_js
-node_js:
- - "lts/*"
+sudo: true
+language: minimal
addons:
apt:
packages:
+ - appstream-util
+ - chromium-browser
+ - curl
+ - git
+ - libvirt-daemon-system
+ - npm
+ - python3-libvirt
+ - qemu-kvm
+ - qemu-utils
+ - rpm
- sassc
+env:
+ - TEST_OS=fedora-33
+ - TEST_OS=centos-8-stream
script:
- - make
+ # HACK: /dev/kvm is root:kvm 0660 by default
+ - sudo chmod 666 /dev/kvm
+
+ # test PO template generation
- make po/starter-kit.pot
+
+ # FIXME: build rpm inside VM; no installed rpms on Travis Ubuntu environment
+ - sed -i '/^BuildRequires:/d' *.spec.in
+
+ - TEST_JOBS=$(nproc) make check
diff --git a/README.md b/README.md
index 1a4e6a2..5f191b6 100644
--- a/README.md
+++ b/README.md
@@ -80,6 +80,13 @@ You can also run the test against a different Cockpit image, for example:
TEST_OS=fedora-32 make check
+These tests can be run in [Travis CI](https://travis-ci.com/). The included
+[travis.yml](./.travis.yml) runs the integration tests for two operating
+systems (Fedora and CentOS 8). Note that if/once your project grows bigger, or
+gets frequent changes, you likely need to move to a paid account, or different
+infrastructure with more capacity. Talk to the
+[Cockpit developers](https://cockpit-project.org/) if you are interested in that.
+
# Customizing
After cloning the Starter Kit you should rename the files, package names, and
From 7dacf49b9a15f9e0f0cc603c049b339cf5c9a915 Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Fri, 30 Oct 2020 02:17:04 +0000
Subject: [PATCH 150/942] package.json: Update @patternfly/react-core package
dependency
Closes #389
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index df79c5b..d7b8d35 100644
--- a/package.json
+++ b/package.json
@@ -46,7 +46,7 @@
},
"dependencies": {
"@patternfly/patternfly": "4.59.1",
- "@patternfly/react-core": "4.63.3",
+ "@patternfly/react-core": "4.75.2",
"core-js": "3.6.5",
"react": "16.14.0",
"react-dom": "16.14.0"
From 92f009d4893f2062120eca5a9ff5f3c4761cdc46 Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Sat, 7 Nov 2020 02:19:27 +0000
Subject: [PATCH 151/942] package.json: Update core-js package dependency
Closes #392
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index d7b8d35..f37093c 100644
--- a/package.json
+++ b/package.json
@@ -47,7 +47,7 @@
"dependencies": {
"@patternfly/patternfly": "4.59.1",
"@patternfly/react-core": "4.75.2",
- "core-js": "3.6.5",
+ "core-js": "3.7.0",
"react": "16.14.0",
"react-dom": "16.14.0"
}
From b49d1d48dc640793e2005f1245f9578ed5d0c819 Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Thu, 19 Nov 2020 02:20:44 +0000
Subject: [PATCH 152/942] package.json: Update @patternfly/react-core package
dependency
Closes #393
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index f37093c..4a2357c 100644
--- a/package.json
+++ b/package.json
@@ -46,7 +46,7 @@
},
"dependencies": {
"@patternfly/patternfly": "4.59.1",
- "@patternfly/react-core": "4.75.2",
+ "@patternfly/react-core": "4.79.2",
"core-js": "3.7.0",
"react": "16.14.0",
"react-dom": "16.14.0"
From 5f3c5c8436e41e6552a6813f21ec0591c4f00f7a Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Fri, 20 Nov 2020 02:22:35 +0000
Subject: [PATCH 153/942] package.json: Update @patternfly/patternfly package
dependency
Closes #394
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 4a2357c..3deb8f1 100644
--- a/package.json
+++ b/package.json
@@ -45,7 +45,7 @@
"webpack-cli": "^3.3.5"
},
"dependencies": {
- "@patternfly/patternfly": "4.59.1",
+ "@patternfly/patternfly": "4.65.6",
"@patternfly/react-core": "4.79.2",
"core-js": "3.7.0",
"react": "16.14.0",
From c1c2d83b819d8629d8e841ce00d8770126d509bb Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Wed, 25 Nov 2020 20:02:04 +0100
Subject: [PATCH 154/942] Bump test/common dependency to 233
This gets rid of the hack for
.
---
Makefile | 2 +-
test/vm.install | 3 ---
2 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
index 5f9e22b..8893a65 100644
--- a/Makefile
+++ b/Makefile
@@ -154,7 +154,7 @@ bots:
# when you start a new project, use the latest release, and update it from time to time
test/common:
flock Makefile sh -ec '\
- git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 230; \
+ git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 233; \
git checkout --force FETCH_HEAD -- test/common; \
git reset test/common'
diff --git a/test/vm.install b/test/vm.install
index 5241745..55e548d 100644
--- a/test/vm.install
+++ b/test/vm.install
@@ -10,6 +10,3 @@ if type firewall-cmd >/dev/null 2>&1; then
firewall-cmd --add-service=cockpit --permanent
fi
systemctl enable cockpit.socket
-
-# HACK: See https://github.com/cockpit-project/cockpit/issues/14133
-mkdir -p /usr/share/cockpit/packagekit
From d3d1df553347329a0d03eab6f6dd9d0fbf49430b Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Thu, 26 Nov 2020 02:23:28 +0000
Subject: [PATCH 155/942] package.json: Update core-js package dependency
Closes #397
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 3deb8f1..9c98c7d 100644
--- a/package.json
+++ b/package.json
@@ -47,7 +47,7 @@
"dependencies": {
"@patternfly/patternfly": "4.65.6",
"@patternfly/react-core": "4.79.2",
- "core-js": "3.7.0",
+ "core-js": "3.8.0",
"react": "16.14.0",
"react-dom": "16.14.0"
}
From 8ea62cb4d7e2ee5e0f31fb9dd159425d5d9b8e32 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Sun, 22 Nov 2020 12:11:12 +0100
Subject: [PATCH 156/942] webpack: Drop unnecessary output settings
The default of `path` and `sourceMapFilename` are already what we want,
no need to set them explicitly.
The `output.filename` is already `[name].js`, and it's totally not
important to name the file differently in production mode (it will then
just be `index.js.gz`, compared to index.js in development mode).
---
webpack.config.js | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/webpack.config.js b/webpack.config.js
index 386ea37..28723ce 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -12,7 +12,6 @@ var externals = {
/* These can be overridden, typically from the Makefile.am */
const srcdir = (process.env.SRCDIR || __dirname) + path.sep + "src";
const builddir = (process.env.SRCDIR || __dirname);
-const distdir = builddir + path.sep + "dist";
const section = process.env.ONLYDIR || null;
const nodedir = path.resolve((process.env.SRCDIR || __dirname), "node_modules");
@@ -31,12 +30,6 @@ var info = {
],
};
-var output = {
- path: distdir,
- filename: "[name].js",
- sourceMapFilename: "[file].map",
-};
-
/*
* Note that we're avoiding the use of path.join as webpack and nodejs
* want relative paths that start with ./ explicitly.
@@ -84,9 +77,6 @@ var plugins = [
/* Only minimize when in production mode */
if (production) {
- /* Rename output files when minimizing */
- output.filename = "[name].min.js";
-
plugins.unshift(new CompressionPlugin({
test: /\.(js|html)$/,
minRatio: 0.9,
@@ -126,7 +116,6 @@ module.exports = {
},
entry: info.entries,
externals: externals,
- output: output,
devtool: "source-map",
module: {
rules: [
From 8aad356edb107cab09931ea85f381ea9f1248513 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Sun, 22 Nov 2020 12:19:38 +0100
Subject: [PATCH 157/942] webpack: Simplify externals declaration
This is simple enough to be inline, and it's also not meant to be
expanded: `cockpit` is the only legit external symbol, everything else
ought to be bundled.
---
webpack.config.js | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/webpack.config.js b/webpack.config.js
index 28723ce..9ce0c4b 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -5,10 +5,6 @@ const fs = require("fs");
const webpack = require("webpack");
const CompressionPlugin = require("compression-webpack-plugin");
-var externals = {
- "cockpit": "cockpit",
-};
-
/* These can be overridden, typically from the Makefile.am */
const srcdir = (process.env.SRCDIR || __dirname) + path.sep + "src";
const builddir = (process.env.SRCDIR || __dirname);
@@ -115,7 +111,8 @@ module.exports = {
ignored: /node_modules/,
},
entry: info.entries,
- externals: externals,
+ // cockpit.js gets included via
-
+
From 88fe99361be4f5ff3e646901f054fad749d7caa1 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Sat, 26 Dec 2020 08:29:49 +0100
Subject: [PATCH 182/942] Simplify translation template
`this.po` is not being used anywhere, so drop the whole `!loaded` code
path. There is no defer mechanism, so `po.js` *must* be loaded after
cockpit.js. Let's trigger a crash instead of silently dropping
translations, to make such a bug obvious in manual and automatic tests.
---
po/po.empty.js | 16 ++--------------
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/po/po.empty.js b/po/po.empty.js
index b27dad9..7c2d480 100644
--- a/po/po.empty.js
+++ b/po/po.empty.js
@@ -1,14 +1,2 @@
-(function (root, data) {
- var loaded, module;
-
- /* Load into Cockpit locale */
- if (typeof cockpit === 'object') {
- cockpit.locale(data)
- loaded = true;
- }
-
- if (!loaded)
- root.po = data;
-
-/* The syntax of this line is important by po2json */
-}(this, {"":{"language":"en"}}));
+/* The syntax of this line is important for po2json */
+cockpit.locale({"":{"language":"en"}});
From 07017f79d865281553fff0c258448a0a72c154ea Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Wed, 30 Dec 2020 10:08:48 +0100
Subject: [PATCH 183/942] Eliminate POTFILES.*.in files
The `find` is so cheap that there is little point in the POTFILES.*.in
indirection.
---
Makefile | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)
diff --git a/Makefile b/Makefile
index 8aac539..02338d2 100644
--- a/Makefile
+++ b/Makefile
@@ -21,25 +21,17 @@ all: $(WEBPACK_TEST)
LINGUAS=$(basename $(notdir $(wildcard po/*.po)))
-po/POTFILES.js.in:
- mkdir -p $(dir $@)
- find src/ -name '*.js' -o -name '*.jsx' > $@
-
-po/$(PACKAGE_NAME).js.pot: po/POTFILES.js.in
+po/$(PACKAGE_NAME).js.pot:
xgettext --default-domain=cockpit --output=$@ --language=C --keyword= \
--keyword=_:1,1t --keyword=_:1c,2,1t --keyword=C_:1c,2 \
--keyword=N_ --keyword=NC_:1c,2 \
--keyword=gettext:1,1t --keyword=gettext:1c,2,2t \
--keyword=ngettext:1,2,3t --keyword=ngettext:1c,2,3,4t \
--keyword=gettextCatalog.getString:1,3c --keyword=gettextCatalog.getPlural:2,3,4c \
- --from-code=UTF-8 --files-from=$^
+ --from-code=UTF-8 $$(find src/ -name '*.js' -o -name '*.jsx')
-po/POTFILES.html.in:
- mkdir -p $(dir $@)
- find src -name '*.html' > $@
-
-po/$(PACKAGE_NAME).html.pot: po/POTFILES.html.in $(NODE_MODULES_TEST)
- po/html2po -f $^ -o $@
+po/$(PACKAGE_NAME).html.pot: $(NODE_MODULES_TEST)
+ po/html2po -o $@ $$(find src -name '*.html')
po/$(PACKAGE_NAME).manifest.pot: $(NODE_MODULES_TEST)
po/manifest2po src/manifest.json -o $@
From 7f6ef51c12a75591aa635ae125bf8e20f23e0027 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Tue, 5 Jan 2021 14:52:59 +0100
Subject: [PATCH 184/942] Build translations with webpack
Convert the `po2json` script into a webpack plugin, and integrate the
(now trivial) po.empty.js template.
This is the last step for building the entire dist/ directory with
`npm run build` (i.e. a tool that web developers are familiar with),
and not having a split webpack+make toolchain any more.
---
Makefile | 7 +-
po/po.empty.js | 2 -
po/po2json | 127 -----------------------------------
src/lib/cockpit-po-plugin.js | 74 ++++++++++++++++++++
webpack.config.js | 8 ++-
5 files changed, 81 insertions(+), 137 deletions(-)
delete mode 100644 po/po.empty.js
delete mode 100755 po/po2json
create mode 100644 src/lib/cockpit-po-plugin.js
diff --git a/Makefile b/Makefile
index 02338d2..22361c7 100644
--- a/Makefile
+++ b/Makefile
@@ -45,11 +45,6 @@ update-po: po/$(PACKAGE_NAME).pot
msgmerge --output-file=po/$$lang.po po/$$lang.po $<; \
done
-dist/po.%.js: po/%.po $(NODE_MODULES_TEST)
- mkdir -p $(dir $@)
- po/po2json -m po/po.empty.js -o $@.js.tmp $<
- mv $@.js.tmp $@
-
#
# Build/Install/dist
#
@@ -57,7 +52,7 @@ dist/po.%.js: po/%.po $(NODE_MODULES_TEST)
%.spec: %.spec.in
sed -e 's/%{VERSION}/$(VERSION)/g' $< > $@
-$(WEBPACK_TEST): $(NODE_MODULES_TEST) src/lib/patternfly/_fonts.scss $(shell find src/ -type f) package.json webpack.config.js $(patsubst %,dist/po.%.js,$(LINGUAS))
+$(WEBPACK_TEST): $(NODE_MODULES_TEST) src/lib/patternfly/_fonts.scss $(shell find src/ -type f) package.json webpack.config.js
NODE_ENV=$(NODE_ENV) npm run build
watch:
diff --git a/po/po.empty.js b/po/po.empty.js
deleted file mode 100644
index 7c2d480..0000000
--- a/po/po.empty.js
+++ /dev/null
@@ -1,2 +0,0 @@
-/* The syntax of this line is important for po2json */
-cockpit.locale({"":{"language":"en"}});
diff --git a/po/po2json b/po/po2json
deleted file mode 100755
index 690d7d0..0000000
--- a/po/po2json
+++ /dev/null
@@ -1,127 +0,0 @@
-#!/usr/bin/env node
-
-function fatal(message, code) {
- console.log((filename || "html2po") + ": " + message);
- process.exit(code || 1);
-}
-
-function usage() {
- console.log("usage: po2json [--module=template.js] [--output=output.js] input");
- process.exit(2);
-}
-
-var fs, po2json, Jed, stdio;
-
-try {
- fs = require('fs');
- po2json = require('po2json');
- Jed = require('jed');
- stdio = require('stdio');
-} catch(ex) {
- fatal(ex.message, 127); /* missing looks for this */
-}
-
-var argi = 2;
-var filename = null;
-
-var opts = stdio.getopt({
- module: { key: "m", args: 1, description: "Module template to include", default: "" },
- output: { key: "o", args: 1, description: "Output file", default: "" },
-});
-
-if (!opts.args || opts.args.length != 1) {
- usage();
-}
-
-parse();
-
-function prepareHeader(header) {
- var body, statement, plurals = header["plural-forms"], ret = null;
- if (plurals) {
- try {
- /* Check that the plural forms isn't being sneaky since we build a function here */
- Jed.PF.parse(plurals);
- } catch(ex) {
- fatal("bad plural forms: " + ex.message, 1);
- }
-
- /* A function for the front end */
- statement = header["plural-forms"];
- if (statement[statement.length - 1] != ';')
- statement += ';';
- ret = 'function(n) {\nvar nplurals, plural;\n' + statement + '\nreturn plural;\n}';
-
- /* Added back in later */
- delete header["plural-forms"];
- }
-
- /* We don't need to be transferring this */
- delete header["project-id-version"];
- delete header["report-msgid-bugs-to"];
- delete header["pot-creation-date"];
- delete header["po-revision-date"];
- delete header["last-translator"];
- delete header["language-team"];
- delete header["mime-version"];
- delete header["content-type"];
- delete header["content-transfer-encoding"];
-
- return ret;
-}
-
-/* Parse and process the po data */
-function parse() {
- filename = opts.args[0];
- po2json.parseFile(opts.args[0], { "fuzzy": false }, function(err, jsonData) {
- var plurals, pos;
-
- if (err)
- fatal(err.message);
-
- var header = jsonData[""];
- if (header)
- plurals = prepareHeader(header);
-
- var data = JSON.stringify(jsonData, null, 1);
-
- /* We know the brace in is the location to insert our function */
- if (plurals) {
- pos = data.indexOf('{', 1);
- data = data.substr(0, pos + 1) + "'plural-forms':" + String(plurals) + "," + data.substr(pos + 1);
- }
-
- if (data == JSON.stringify({}))
- finish("");
- else
- wrap(data);
- });
-}
-
-/* Wrap the data if desired */
-function wrap(data) {
- if (opts.module) {
- filename = opts.module;
- fs.readFile(opts.module, { encoding: "utf-8" }, function(err, template) {
- if (err)
- fatal(err.message);
- data = template.replace('{"":{"language":"en"}}', data);
- finish(data);
- });
- } else {
- finish(data);
- }
-}
-
-/* Write it out */
-function finish(data) {
- if (opts.output) {
- fs.writeFile(opts.output, data, function(err) {
- if (err)
- fatal(err.message);
- process.exit(0);
- });
- } else {
- process.stdout.write(data);
- process.exit(0);
- }
-}
diff --git a/src/lib/cockpit-po-plugin.js b/src/lib/cockpit-po-plugin.js
new file mode 100644
index 0000000..4cf0f28
--- /dev/null
+++ b/src/lib/cockpit-po-plugin.js
@@ -0,0 +1,74 @@
+const path = require("path");
+const glob = require("glob");
+const po2json = require('po2json');
+const Jed = require('jed');
+
+module.exports = class {
+ apply(compiler) {
+ compiler.hooks.emit.tapPromise(
+ 'CockpitPoPlugin',
+ compilation => Promise.all(glob.sync('po/*.po').map(f => this.buildFile(f, compilation)))
+ );
+ }
+
+ prepareHeader(header) {
+ if (!header)
+ return null;
+
+ var body, statement, ret = null;
+ const plurals = header["plural-forms"];
+
+ if (plurals) {
+ try {
+ /* Check that the plural forms isn't being sneaky since we build a function here */
+ Jed.PF.parse(plurals);
+ } catch(ex) {
+ fatal("bad plural forms: " + ex.message, 1);
+ }
+
+ /* A function for the front end */
+ statement = header["plural-forms"];
+ if (statement[statement.length - 1] != ';')
+ statement += ';';
+ ret = 'function(n) {\nvar nplurals, plural;\n' + statement + '\nreturn plural;\n}';
+
+ /* Added back in later */
+ delete header["plural-forms"];
+ }
+
+ /* We don't need to be transferring this */
+ delete header["project-id-version"];
+ delete header["report-msgid-bugs-to"];
+ delete header["pot-creation-date"];
+ delete header["po-revision-date"];
+ delete header["last-translator"];
+ delete header["language-team"];
+ delete header["mime-version"];
+ delete header["content-type"];
+ delete header["content-transfer-encoding"];
+
+ return ret;
+ }
+
+ buildFile(po_file, compilation) {
+ return new Promise((resolve, reject) => {
+ const jsonData = po2json.parseFileSync(po_file);
+ const plurals = this.prepareHeader(jsonData[""]);
+
+ let output = JSON.stringify(jsonData, null, 1);
+
+ // We know the brace in is the location to insert our function
+ if (plurals) {
+ pos = output.indexOf('{', 1);
+ output = output.substr(0, pos + 1) + "'plural-forms':" + String(plurals) + "," + output.substr(pos + 1);
+ }
+
+ // wrap JSON output into cockpit.locale() call
+ output = 'cockpit.locale(' + output + ');\n';
+
+ const lang = path.basename(po_file).slice(0, -3)
+ compilation.assets['po.' + lang + '.js'] = { source: () => output, size: () => output.length };
+ resolve();
+ });
+ };
+};
diff --git a/webpack.config.js b/webpack.config.js
index 92035c3..f02c0b9 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -1,11 +1,14 @@
const path = require("path");
const childProcess = require('child_process');
+
const copy = require("copy-webpack-plugin");
const extract = require("mini-css-extract-plugin");
const TerserJSPlugin = require('terser-webpack-plugin');
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
-const webpack = require("webpack");
const CompressionPlugin = require("compression-webpack-plugin");
+const CockpitPoPlugin = require("./src/lib/cockpit-po-plugin");
+
+const webpack = require("webpack");
const nodedir = path.resolve((process.env.SRCDIR || __dirname), "node_modules");
@@ -20,7 +23,8 @@ const copy_files = [
const plugins = [
new copy({ patterns: copy_files }),
- new extract({filename: "[name].css"})
+ new extract({filename: "[name].css"}),
+ new CockpitPoPlugin(),
];
/* Only minimize when in production mode */
From e418cba057114553dd81626b3ae9dde902436625 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Thu, 7 Jan 2021 08:11:22 +0100
Subject: [PATCH 185/942] cockpit-po-plugin: Fix crash with plural forms
Declare the `pos` variable. Fixes regression introduced in commit
7f6ef51c12a7.
Add plural forms to German translations to exercise this code path.
---
po/de.po | 1 +
src/lib/cockpit-po-plugin.js | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/po/de.po b/po/de.po
index cc551d7..91b4e60 100644
--- a/po/de.po
+++ b/po/de.po
@@ -12,6 +12,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=n != 1\n"
#: src/index.html:20
msgid "Cockpit Starter Kit"
diff --git a/src/lib/cockpit-po-plugin.js b/src/lib/cockpit-po-plugin.js
index 4cf0f28..221a6ca 100644
--- a/src/lib/cockpit-po-plugin.js
+++ b/src/lib/cockpit-po-plugin.js
@@ -59,7 +59,7 @@ module.exports = class {
// We know the brace in is the location to insert our function
if (plurals) {
- pos = output.indexOf('{', 1);
+ const pos = output.indexOf('{', 1);
output = output.substr(0, pos + 1) + "'plural-forms':" + String(plurals) + "," + output.substr(pos + 1);
}
From 786fd20df5e08a2db5e656c95e3fbfb4adad3a09 Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Wed, 20 Jan 2021 03:22:50 +0000
Subject: [PATCH 186/942] package.json: Update core-js package dependency
Closes #415
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 2c14522..321d411 100644
--- a/package.json
+++ b/package.json
@@ -49,7 +49,7 @@
"dependencies": {
"@patternfly/patternfly": "4.70.2",
"@patternfly/react-core": "4.84.4",
- "core-js": "3.8.2",
+ "core-js": "3.8.3",
"react": "16.14.0",
"react-dom": "16.14.0"
}
From bb064229967f8f1d65c160646ef3ef081cfa62e7 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Fri, 22 Jan 2021 16:04:35 +0100
Subject: [PATCH 187/942] Use Cockpit webpack helpers from cockpit.git
Drop the cockpit-po-plugin.js and sassc-loader.js code copies, and check
them out from a stable cockpit tag, similarly to how we already get the
PatternFly CSS.
---
.gitignore | 2 +-
Makefile | 18 +++++----
src/lib/cockpit-po-plugin.js | 74 ------------------------------------
src/lib/sassc-loader.js | 25 ------------
4 files changed, 11 insertions(+), 108 deletions(-)
delete mode 100644 src/lib/cockpit-po-plugin.js
delete mode 100644 src/lib/sassc-loader.js
diff --git a/.gitignore b/.gitignore
index b28fd69..59b5f3d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,6 +11,6 @@ Test*FAIL*
bots/
test/common/
test/images/
-src/lib/patternfly/
+src/lib/
*.pot
POTFILES*
diff --git a/Makefile b/Makefile
index 22361c7..5e8353c 100644
--- a/Makefile
+++ b/Makefile
@@ -12,6 +12,8 @@ VM_IMAGE=$(CURDIR)/test/images/$(TEST_OS)
NODE_MODULES_TEST=package-lock.json
# one example file in dist/ from webpack to check if that already ran
WEBPACK_TEST=dist/manifest.json
+# one example file in src/lib to check if it was already checked out
+LIB_TEST=src/lib/cockpit-po-plugin.js
all: $(WEBPACK_TEST)
@@ -52,7 +54,7 @@ update-po: po/$(PACKAGE_NAME).pot
%.spec: %.spec.in
sed -e 's/%{VERSION}/$(VERSION)/g' $< > $@
-$(WEBPACK_TEST): $(NODE_MODULES_TEST) src/lib/patternfly/_fonts.scss $(shell find src/ -type f) package.json webpack.config.js
+$(WEBPACK_TEST): $(NODE_MODULES_TEST) $(LIB_TEST) $(shell find src/ -type f) package.json webpack.config.js
NODE_ENV=$(NODE_ENV) npm run build
watch:
@@ -87,7 +89,7 @@ $(TARFILE): $(WEBPACK_TEST) cockpit-$(PACKAGE_NAME).spec
touch dist/*
tar czf cockpit-$(PACKAGE_NAME)-$(VERSION).tar.gz --transform 's,^,cockpit-$(PACKAGE_NAME)/,' \
--exclude cockpit-$(PACKAGE_NAME).spec.in \
- $$(git ls-files) src/lib/patternfly/*.scss package-lock.json cockpit-$(PACKAGE_NAME).spec dist/
+ $$(git ls-files) $(LIB_TEST) src/lib/patternfly/*.scss package-lock.json cockpit-$(PACKAGE_NAME).spec dist/
mv node_modules.release node_modules
srpm: $(TARFILE) cockpit-$(PACKAGE_NAME).spec
@@ -145,13 +147,13 @@ test/common:
git checkout --force FETCH_HEAD -- test/common; \
git reset test/common'
-src/lib/patternfly/_fonts.scss:
+# checkout Cockpit's PF/React/build library; again this has no API stability guarantee, so check out a stable tag
+$(LIB_TEST):
flock Makefile sh -ec '\
- git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 227; \
- mkdir -p pkg/lib/patternfly && git add pkg/lib/patternfly; \
- git checkout --force FETCH_HEAD -- pkg/lib/patternfly; \
- git reset -- pkg/lib/patternfly'
- mkdir -p src/lib && mv pkg/lib/patternfly src/lib/patternfly && rmdir -p pkg/lib
+ git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 236; \
+ git checkout --force FETCH_HEAD -- pkg/lib; \
+ git reset -- pkg/lib'
+ mv pkg/lib src/ && rmdir -p pkg
$(NODE_MODULES_TEST): package.json
# if it exists already, npm install won't update it; force that so that we always get up-to-date packages
diff --git a/src/lib/cockpit-po-plugin.js b/src/lib/cockpit-po-plugin.js
deleted file mode 100644
index 221a6ca..0000000
--- a/src/lib/cockpit-po-plugin.js
+++ /dev/null
@@ -1,74 +0,0 @@
-const path = require("path");
-const glob = require("glob");
-const po2json = require('po2json');
-const Jed = require('jed');
-
-module.exports = class {
- apply(compiler) {
- compiler.hooks.emit.tapPromise(
- 'CockpitPoPlugin',
- compilation => Promise.all(glob.sync('po/*.po').map(f => this.buildFile(f, compilation)))
- );
- }
-
- prepareHeader(header) {
- if (!header)
- return null;
-
- var body, statement, ret = null;
- const plurals = header["plural-forms"];
-
- if (plurals) {
- try {
- /* Check that the plural forms isn't being sneaky since we build a function here */
- Jed.PF.parse(plurals);
- } catch(ex) {
- fatal("bad plural forms: " + ex.message, 1);
- }
-
- /* A function for the front end */
- statement = header["plural-forms"];
- if (statement[statement.length - 1] != ';')
- statement += ';';
- ret = 'function(n) {\nvar nplurals, plural;\n' + statement + '\nreturn plural;\n}';
-
- /* Added back in later */
- delete header["plural-forms"];
- }
-
- /* We don't need to be transferring this */
- delete header["project-id-version"];
- delete header["report-msgid-bugs-to"];
- delete header["pot-creation-date"];
- delete header["po-revision-date"];
- delete header["last-translator"];
- delete header["language-team"];
- delete header["mime-version"];
- delete header["content-type"];
- delete header["content-transfer-encoding"];
-
- return ret;
- }
-
- buildFile(po_file, compilation) {
- return new Promise((resolve, reject) => {
- const jsonData = po2json.parseFileSync(po_file);
- const plurals = this.prepareHeader(jsonData[""]);
-
- let output = JSON.stringify(jsonData, null, 1);
-
- // We know the brace in is the location to insert our function
- if (plurals) {
- const pos = output.indexOf('{', 1);
- output = output.substr(0, pos + 1) + "'plural-forms':" + String(plurals) + "," + output.substr(pos + 1);
- }
-
- // wrap JSON output into cockpit.locale() call
- output = 'cockpit.locale(' + output + ');\n';
-
- const lang = path.basename(po_file).slice(0, -3)
- compilation.assets['po.' + lang + '.js'] = { source: () => output, size: () => output.length };
- resolve();
- });
- };
-};
diff --git a/src/lib/sassc-loader.js b/src/lib/sassc-loader.js
deleted file mode 100644
index aeffd6a..0000000
--- a/src/lib/sassc-loader.js
+++ /dev/null
@@ -1,25 +0,0 @@
-const fs = require('fs');
-const path = require('path');
-const childProcess = require('child_process');
-
-/* source is not used. This must be the first loader in the chain, using this.resource, so that sassc can include the scss file's directory in the include path */
-module.exports = function() {
- this.cacheable();
-
- const workdir = fs.mkdtempSync("sassc-loader.");
- const out = path.join(workdir, "output.css");
-
- childProcess.execFileSync(
- 'sassc',
- ['--load-path=node_modules', '--style=compressed', '--sourcemap', this.resource, out],
- { stdio: ['pipe', 'inherit', 'inherit'] });
-
- const css = fs.readFileSync(out, 'utf8');
- const cssmap = fs.readFileSync(out + ".map", 'utf8');
-
- fs.unlinkSync(out);
- fs.unlinkSync(out + ".map");
- fs.rmdirSync(workdir);
-
- this.callback(null, css, cssmap);
-};
From 4c3d90d3b3a3d6f40358ecdceca001b31b9f4d99 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Tue, 26 Jan 2021 05:25:40 +0100
Subject: [PATCH 188/942] Run tests on Cirrus CI, drop Travis (#416)
Travis stopped handing out free credits since their plan changes last
November, so tests have not run since then.
Cirrus CI offers an API similar to Travis, and also explicitly supports
/dev/kvm access.
Eventually we want to use the cockpit/tasks container directly. But we
can't fix the /dev/kvm permissions inside that as `sudo` does not work
in that. Once we fix that, the setup will become much cheaper and
simpler.
---
.cirrus.yml | 23 +++++++++++++++++++++++
.travis.yml | 31 -------------------------------
README.md | 20 +++++++++++++-------
3 files changed, 36 insertions(+), 38 deletions(-)
create mode 100644 .cirrus.yml
delete mode 100644 .travis.yml
diff --git a/.cirrus.yml b/.cirrus.yml
new file mode 100644
index 0000000..df2a5d6
--- /dev/null
+++ b/.cirrus.yml
@@ -0,0 +1,23 @@
+container:
+ # We should use quay.io/cockpit/tasks here and avoid package installation, but we can't currently run sudo in that container to fix /dev/kvm permissions
+ image: docker.io/fedora
+ kvm: true
+ # increase this if you have many tests that benefit from parallelism
+ cpu: 1
+
+test_task:
+ env:
+ matrix:
+ - TEST_OS: fedora-33
+ - TEST_OS: centos-8-stream
+
+ setup_script:
+ - chmod 666 /dev/kvm
+ - dnf install -y chromium-headless curl git libappstream-glib libvirt-daemon-kvm libvirt-client libvirt-python3 make npm rpm-build rpmdevtools sassc tar
+ - useradd build
+ - chown -R build:build .
+
+ # test PO template generation
+ pot_build_script: su -c 'make po/starter-kit.pot' build
+
+ check_script: su -c "TEST_JOBS=$(nproc) TEST_OS=$TEST_OS make check" build
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 3527496..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,31 +0,0 @@
-dist: focal
-sudo: true
-language: minimal
-addons:
- apt:
- packages:
- - appstream-util
- - chromium-browser
- - curl
- - git
- - libvirt-daemon-system
- - npm
- - python3-libvirt
- - qemu-kvm
- - qemu-utils
- - rpm
- - sassc
-env:
- - TEST_OS=fedora-33
- - TEST_OS=centos-8-stream
-script:
- # HACK: /dev/kvm is root:kvm 0660 by default
- - sudo chmod 666 /dev/kvm
-
- # test PO template generation
- - make po/starter-kit.pot
-
- # FIXME: build rpm inside VM; no installed rpms on Travis Ubuntu environment
- - sed -i '/^BuildRequires:/d' *.spec.in
-
- - TEST_JOBS=$(nproc) make check
diff --git a/README.md b/README.md
index 5f191b6..33bd097 100644
--- a/README.md
+++ b/README.md
@@ -60,7 +60,7 @@ Violations of some rules can be fixed automatically by:
Rules configuration can be found in the `.eslintrc.json` file.
-# Automated Testing
+# Running tests locally
Run `make check` to build an RPM, install it into a standard Cockpit test VM
(centos-7 by default), and run the test/check-application integration test on
@@ -80,12 +80,18 @@ You can also run the test against a different Cockpit image, for example:
TEST_OS=fedora-32 make check
-These tests can be run in [Travis CI](https://travis-ci.com/). The included
-[travis.yml](./.travis.yml) runs the integration tests for two operating
-systems (Fedora and CentOS 8). Note that if/once your project grows bigger, or
-gets frequent changes, you likely need to move to a paid account, or different
-infrastructure with more capacity. Talk to the
-[Cockpit developers](https://cockpit-project.org/) if you are interested in that.
+# Running tests in CI
+
+These tests can be run in [Cirrus CI](https://cirrus-ci.org/), on their free
+[Linux Containers](https://cirrus-ci.org/guide/linux/) environment which
+explicitly supports `/dev/kvm`. Please see [Quick
+Start](https://cirrus-ci.org/guide/quick-start/) how to set up Cirrus CI for
+your project after forking from starter-kit.
+
+The included [.cirrus.yml](./.cirrus.yml) runs the integration tests for two
+operating systems (Fedora and CentOS 8). Note that if/once your project grows
+bigger, or gets frequent changes, you may need to move to a paid account, or
+different infrastructure with more capacity.
# Customizing
From e031456805d769883b994339f9b8ee988fa94f19 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Tue, 26 Jan 2021 07:59:19 +0100
Subject: [PATCH 189/942] tests: Use cockpit/tasks container in Cirrus CI
This avoids the lengthy (and potentially brittle) installation of
dependencies and having to create an unprivileged user.
Since [1] the tasks container can now fix /dev/kvm permissions.
[1] https://github.com/cockpit-project/cockpituous/pull/366
---
.cirrus.yml | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/.cirrus.yml b/.cirrus.yml
index df2a5d6..4a0c6df 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -1,6 +1,8 @@
container:
- # We should use quay.io/cockpit/tasks here and avoid package installation, but we can't currently run sudo in that container to fix /dev/kvm permissions
- image: docker.io/fedora
+ # official cockpit CI container, with cockpit related build and test dependencies
+ # if you want to use your own, see the documentation about required packages:
+ # https://github.com/cockpit-project/cockpit/blob/master/HACKING.md#getting-the-development-dependencies
+ image: quay.io/cockpit/tasks
kvm: true
# increase this if you have many tests that benefit from parallelism
cpu: 1
@@ -11,13 +13,9 @@ test_task:
- TEST_OS: fedora-33
- TEST_OS: centos-8-stream
- setup_script:
- - chmod 666 /dev/kvm
- - dnf install -y chromium-headless curl git libappstream-glib libvirt-daemon-kvm libvirt-client libvirt-python3 make npm rpm-build rpmdevtools sassc tar
- - useradd build
- - chown -R build:build .
+ fix_kvm_script: sudo chmod 666 /dev/kvm
# test PO template generation
- pot_build_script: su -c 'make po/starter-kit.pot' build
+ pot_build_script: make po/starter-kit.pot
- check_script: su -c "TEST_JOBS=$(nproc) TEST_OS=$TEST_OS make check" build
+ check_script: TEST_JOBS=$(nproc) TEST_OS=$TEST_OS make check
From dfeb49484c2853685871bc14830626a0187a0470 Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Thu, 28 Jan 2021 02:39:34 +0000
Subject: [PATCH 190/942] package.json: Update @patternfly package dependencies
Closes #418
---
package.json | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/package.json b/package.json
index 321d411..b80df38 100644
--- a/package.json
+++ b/package.json
@@ -47,8 +47,8 @@
"webpack-cli": "^3.3.5"
},
"dependencies": {
- "@patternfly/patternfly": "4.70.2",
- "@patternfly/react-core": "4.84.4",
+ "@patternfly/patternfly": "4.80.3",
+ "@patternfly/react-core": "4.90.2",
"core-js": "3.8.3",
"react": "16.14.0",
"react-dom": "16.14.0"
From 71a321cc2831345881c87f1b768c713dac07b3e0 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Mon, 1 Feb 2021 11:25:15 +0100
Subject: [PATCH 191/942] Enable webpack watch progress
Without that, `npm run watch` is entirely silent after the first build,
and does not give any feedback when a build starts, and even more
importantly, when it's done.
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index b80df38..1cd790c 100644
--- a/package.json
+++ b/package.json
@@ -7,7 +7,7 @@
"author": "",
"license": "LGPL-2.1",
"scripts": {
- "watch": "webpack --watch",
+ "watch": "webpack --watch --progress",
"build": "webpack",
"eslint": "eslint --ext .js --ext .jsx src/",
"eslint:fix": "eslint --fix --ext .js --ext .jsx src/"
From 6f04071d885ae4f2479a87ca4baf88b6e4945e33 Mon Sep 17 00:00:00 2001
From: Katerina Koukiou
Date: Tue, 9 Feb 2021 13:58:15 +0100
Subject: [PATCH 192/942] Introduce a github action which builds a cockpit
preview when requested
It currently reacts to /livetest comments on PRs and builds cockpit from
the PR's checkout. Then serves it on logs.cockpit-project.org on a port
specified on a follow-up comment to the /livetest.
Cockpit developers can now utilize this workflow to review a PR without
having to pull and compile the code locally.
---
.github/workflows/livetest.yml.disabled | 101 ++++++++++++++++++++++++
1 file changed, 101 insertions(+)
create mode 100644 .github/workflows/livetest.yml.disabled
diff --git a/.github/workflows/livetest.yml.disabled b/.github/workflows/livetest.yml.disabled
new file mode 100644
index 0000000..42a1f80
--- /dev/null
+++ b/.github/workflows/livetest.yml.disabled
@@ -0,0 +1,101 @@
+name: Live test cockpit from PRs
+# Triggered when a repository collaborator comments /livetest on a PR
+# This is currently configured to run on cockpit-project org.
+# If your project lives somewhere else than the github cockpit-project organization,
+# you need to set up your own relay host, add a secret with the private SSH key, and
+# adjust the RELAY_HOST env variable and SINK_SSHRELAY_PRIVATE secret name.
+
+on:
+ issue_comment:
+ types: [created]
+
+jobs:
+ pr-info:
+ runs-on: ubuntu-20.04
+ steps:
+ - name: Query author repository permissions
+ uses: octokit/request-action@v2.x
+ id: user_permission
+ with:
+ route: GET /repos/${{ github.repository }}/collaborators/${{ github.event.sender.login }}/permission
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
+ # restrict /livetest to users with admin or write permission for the repository
+ # see https://docs.github.com/en/free-pro-team@latest/rest/reference/repos#get-repository-permissions-for-a-user
+ # store output if user is allowed in allowed_user job output so it has to be checked in downstream job
+ - name: Check if user does have correct permissions
+ if: contains('admin write', fromJson(steps.user_permission.outputs.data).permission)
+ id: check_user_perm
+ run: |
+ echo "User '${{ github.event.sender.login }}' has permission '${{ fromJson(steps.user_permission.outputs.data).permission }}' allowed values: 'admin', 'write'"
+ echo "::set-output name=allowed_user::true"
+
+ outputs:
+ allowed_user: ${{ steps.check_user_perm.outputs.allowed_user }}
+
+ live-test:
+ needs: pr-info
+ if: needs.pr-info.outputs.allowed_user == 'true' && github.event.issue.pull_request && startsWith(github.event.comment.body, '/livetest')
+ runs-on: ubuntu-20.04
+ env:
+ RELAY_HOST: logs.cockpit-project.org
+ steps:
+ - name: Install dependencies
+ run: |
+ sudo apt update
+ sudo apt install -y cockpit-system cockpit-ws nodejs npm sassc make
+
+ - name: Clone repository
+ uses: actions/checkout@v2
+ with:
+ # need this to also fetch tags
+ fetch-depth: 0
+
+ - name: Compile and install the project
+ run: make && sudo make install
+
+ - name: Create a new test user
+ # WARNING: if you want to add this users to sudoers make sure to propertly delete the SINK_SSHRELAY_PRIVATE
+ run: sudo useradd --create-home livetest; echo livetest:foobar | sudo chpasswd
+
+ - name: Get the commit SHA that triggered the workflow
+ id: get_commit_sha
+ run: |
+ echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
+
+ - name: Get ssh gateway port to forward to
+ id: remote_port
+ env:
+ SHA_SHORT: "${{ steps.get_commit_sha.outputs.sha_short }}"
+ run: |
+ echo ::set-output name=SSH_GATEWAY_PORT::$((16#$SHA_SHORT % 32768 + 1500))
+
+ - name: Write a comment on the PR with link to the cockpit instance
+ uses: actions/github-script@v3
+ with:
+ github-token: ${{ secrets.GITHUB_TOKEN }}
+ script: |
+ github.issues.createComment({
+ issue_number: context.issue.number,
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ body: 'Cockpit preview: https://${{ env.RELAY_HOST }}:${{ steps.remote_port.outputs.SSH_GATEWAY_PORT }}'
+ })
+
+ - name: Create an SSH private key from the secret
+ run: |
+ sudo touch /run/SINK_SSHRELAY_PRIVATE && sudo chown $(id -u):$(id -g) /run/SINK_SSHRELAY_PRIVATE
+ echo "${{ secrets.SINK_SSHRELAY_PRIVATE }}" > /run/SINK_SSHRELAY_PRIVATE
+ chmod 600 /run/SINK_SSHRELAY_PRIVATE
+ mkdir -p ~/.ssh && ssh-keyscan -H ${{ env.RELAY_HOST }} > ~/.ssh/known_hosts
+
+ - name: Forward cockpit port 9090 to a server we can access
+ run: ssh -f -R ':${{ steps.remote_port.outputs.SSH_GATEWAY_PORT }}':localhost:9090 -i /run/SINK_SSHRELAY_PRIVATE -o ExitOnForwardFailure=yes sshgw@${{ env.RELAY_HOST }} 'sleep infinity'
+
+ - name: Block workflow from finishing
+ run: sleep 4h
+
+ - name: Cleanup ssh process
+ if: ${{ always() }}
+ run: pkill ssh || true
From 6abb6b194412004ac7c8713975ed00fce5876fa3 Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Wed, 17 Feb 2021 02:25:47 +0000
Subject: [PATCH 193/942] package.json: Update @patternfly/patternfly,
@patternfly/react-core
Closes #422
---
package.json | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/package.json b/package.json
index 1cd790c..4679811 100644
--- a/package.json
+++ b/package.json
@@ -47,8 +47,8 @@
"webpack-cli": "^3.3.5"
},
"dependencies": {
- "@patternfly/patternfly": "4.80.3",
- "@patternfly/react-core": "4.90.2",
+ "@patternfly/patternfly": "4.87.2",
+ "@patternfly/react-core": "4.97.1",
"core-js": "3.8.3",
"react": "16.14.0",
"react-dom": "16.14.0"
From de806efe168abe7328c3bc6a28cad72f0c07cb13 Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Thu, 18 Feb 2021 02:37:30 +0000
Subject: [PATCH 194/942] package.json: Update @patternfly/react-core,
@patternfly/patternfly
Closes #423
---
package.json | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/package.json b/package.json
index 4679811..9084ff2 100644
--- a/package.json
+++ b/package.json
@@ -47,8 +47,8 @@
"webpack-cli": "^3.3.5"
},
"dependencies": {
- "@patternfly/patternfly": "4.87.2",
- "@patternfly/react-core": "4.97.1",
+ "@patternfly/patternfly": "4.87.3",
+ "@patternfly/react-core": "4.97.2",
"core-js": "3.8.3",
"react": "16.14.0",
"react-dom": "16.14.0"
From 350621b443a5730d85bf5f5eb6e7eec167f173e1 Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Fri, 19 Feb 2021 02:37:38 +0000
Subject: [PATCH 195/942] package.json: Update core-js
Closes #424
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 9084ff2..386bcbc 100644
--- a/package.json
+++ b/package.json
@@ -49,7 +49,7 @@
"dependencies": {
"@patternfly/patternfly": "4.87.3",
"@patternfly/react-core": "4.97.2",
- "core-js": "3.8.3",
+ "core-js": "3.9.0",
"react": "16.14.0",
"react-dom": "16.14.0"
}
From 66c6e9640650622d3b7d157cccc4e66dde3689f3 Mon Sep 17 00:00:00 2001
From: Katerina Koukiou
Date: Wed, 24 Feb 2021 10:48:36 +0100
Subject: [PATCH 196/942] livetest: fix cloning of repo
Previously it was checking out origin/master not the PR's branch.
---
.github/workflows/livetest.yml.disabled | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/livetest.yml.disabled b/.github/workflows/livetest.yml.disabled
index 42a1f80..3130783 100644
--- a/.github/workflows/livetest.yml.disabled
+++ b/.github/workflows/livetest.yml.disabled
@@ -46,11 +46,28 @@ jobs:
sudo apt update
sudo apt install -y cockpit-system cockpit-ws nodejs npm sassc make
- - name: Clone repository
- uses: actions/checkout@v2
+ - uses: actions/github-script@v3
+ id: get-pr
with:
- # need this to also fetch tags
+ script: |
+ const request = {
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ pull_number: context.issue.number
+ }
+ core.info(`Getting PR #${request.pull_number} from ${request.owner}/${request.repo}`)
+ try {
+ const result = await github.pulls.get(request)
+ return result.data
+ } catch (err) {
+ core.setFailed(`Request failed with error ${err}`)
+ }
+
+ - uses: actions/checkout@v2
+ with:
+ repository: ${{ fromJSON(steps.get-pr.outputs.result).head.repo.full_name }}
fetch-depth: 0
+ ref: ${{ fromJSON(steps.get-pr.outputs.result).head.ref }}
- name: Compile and install the project
run: make && sudo make install
From 4171293c48566a826b26c6f02810a822efeb958d Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Thu, 25 Feb 2021 06:24:04 +0100
Subject: [PATCH 197/942] Drop unused version numbers from package.json and
manifest
This field was introduced in
https://github.com/cockpit-project/cockpit/pull/4964 as "purely
informational for now", and isn't even parsed by cockpit.
package.json's version would only be relevant for publishing NPM
modules, but cockpit pages are not that.
Neither starter-kit itself nor our derived projects like cockpit-podman
or cockpit-composer have ever maintained these two fields, so just get
rid of them.
This makes the git tag the single source of truth for the version
number.
Fixes #200
---
package.json | 1 -
src/manifest.json | 1 -
2 files changed, 2 deletions(-)
diff --git a/package.json b/package.json
index 386bcbc..880ca82 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,5 @@
{
"name": "starter-kit",
- "version": "0.1.0",
"description": "Scaffolding for a cockpit module",
"main": "index.js",
"repository": "git@github.com:cockpit/starter-kit.git",
diff --git a/src/manifest.json b/src/manifest.json
index 3e2454a..3a45f56 100644
--- a/src/manifest.json
+++ b/src/manifest.json
@@ -1,5 +1,4 @@
{
- "version": "0.1",
"requires": {
"cockpit": "137"
},
From b000d6b3745575d06e0bb44c23fced4842fea05f Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Thu, 25 Feb 2021 07:58:34 +0100
Subject: [PATCH 198/942] Bump cockpit component library to 238
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 5e8353c..cf5324d 100644
--- a/Makefile
+++ b/Makefile
@@ -150,7 +150,7 @@ test/common:
# checkout Cockpit's PF/React/build library; again this has no API stability guarantee, so check out a stable tag
$(LIB_TEST):
flock Makefile sh -ec '\
- git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 236; \
+ git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 238; \
git checkout --force FETCH_HEAD -- pkg/lib; \
git reset -- pkg/lib'
mv pkg/lib src/ && rmdir -p pkg
From 6b40f35e0492c01e4793669a1e9ec6115d3ebbb9 Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Mon, 1 Mar 2021 02:35:37 +0000
Subject: [PATCH 199/942] package.json: Update core-js
Closes #430
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 880ca82..30f95ce 100644
--- a/package.json
+++ b/package.json
@@ -48,7 +48,7 @@
"dependencies": {
"@patternfly/patternfly": "4.87.3",
"@patternfly/react-core": "4.97.2",
- "core-js": "3.9.0",
+ "core-js": "3.9.1",
"react": "16.14.0",
"react-dom": "16.14.0"
}
From d4c81c9152ff26384f3ffc4f9eaf6d2d764e2ed7 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Thu, 25 Feb 2021 10:34:16 +0100
Subject: [PATCH 200/942] Bump cockpit test API to 239
Replace the deprecated wait_present().
---
Makefile | 2 +-
test/check-application | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index cf5324d..82f6260 100644
--- a/Makefile
+++ b/Makefile
@@ -143,7 +143,7 @@ bots:
# when you start a new project, use the latest release, and update it from time to time
test/common:
flock Makefile sh -ec '\
- git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 233; \
+ git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 239; \
git checkout --force FETCH_HEAD -- test/common; \
git reset test/common'
diff --git a/test/check-application b/test/check-application
index 58e8841..dac2039 100755
--- a/test/check-application
+++ b/test/check-application
@@ -47,7 +47,7 @@ class TestApplication(testlib.MachineCase):
b.expect_load()
# HACK: work around language switching in Chrome not working in current session (Cockpit issue #8160)
b.reload(ignore_cache=True)
- b.wait_present("#content")
+ b.wait_visible("#content")
# menu label (from manifest) should be translated
b.wait_text("#host-apps a[href='/starter-kit']", "Bausatz")
From f02f0fd08f048401d4c17d71591798a4d8e5f16c Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Thu, 4 Mar 2021 07:23:12 +0100
Subject: [PATCH 201/942] Move default TEST_OS to centos-8-stream
We don't run centos-7 in CI any more, and thus can't guarantee that it
works.
---
Makefile | 2 +-
README.md | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
index 82f6260..fde1e12 100644
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@
PACKAGE_NAME := $(shell awk '/"name":/ {gsub(/[",]/, "", $$2); print $$2}' package.json)
VERSION := $(shell T=$$(git describe 2>/dev/null) || T=1; echo $$T | tr '-' '.')
ifeq ($(TEST_OS),)
-TEST_OS = centos-7
+TEST_OS = centos-8-stream
endif
export TEST_OS
TARFILE=cockpit-$(PACKAGE_NAME)-$(VERSION).tar.gz
diff --git a/README.md b/README.md
index 33bd097..8a52ec3 100644
--- a/README.md
+++ b/README.md
@@ -63,7 +63,7 @@ Rules configuration can be found in the `.eslintrc.json` file.
# Running tests locally
Run `make check` to build an RPM, install it into a standard Cockpit test VM
-(centos-7 by default), and run the test/check-application integration test on
+(centos-8-stream by default), and run the test/check-application integration test on
it. This uses Cockpit's Chrome DevTools Protocol based browser tests, through a
Python API abstraction. Note that this API is not guaranteed to be stable, so
if you run into failures and don't want to adjust tests, consider checking out
@@ -74,11 +74,11 @@ After the test VM is prepared, you can manually run the test without rebuilding
the VM, possibly with extra options for tracing and halting on test failures
(for interactive debugging):
- TEST_OS=centos-7 test/check-application -tvs
+ TEST_OS=centos-8-stream test/check-application -tvs
You can also run the test against a different Cockpit image, for example:
- TEST_OS=fedora-32 make check
+ TEST_OS=fedora-34 make check
# Running tests in CI
From 603308d4242aa8b6176adaf98fc6971bb960f0c0 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Thu, 4 Mar 2021 08:37:49 +0100
Subject: [PATCH 202/942] test: Make tests nondestructive
So that they can run in Packit and Fedora dist-git gating.
---
test/check-application | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/test/check-application b/test/check-application
index dac2039..60e545c 100755
--- a/test/check-application
+++ b/test/check-application
@@ -12,7 +12,9 @@ sys.path.append(os.path.join(TEST_DIR, "common"))
sys.path.append(os.path.join(os.path.dirname(TEST_DIR), "bots/machine"))
import testlib
-
+# Nondestructive tests all run in the same running VM. This allows them to run in Packit, Fedora, and RHEL dist-git gating
+# They must not permanently change any file or configuration on the system in a way that influences other tests.
+@testlib.nondestructive
class TestApplication(testlib.MachineCase):
def testBasic(self):
b = self.browser
@@ -27,7 +29,7 @@ class TestApplication(testlib.MachineCase):
b.wait_in_text(".pf-c-alert__title", "Running on " + hostname)
# change current hostname
- m.execute("echo new-%s > /etc/hostname" % hostname)
+ self.write_file("/etc/hostname", "new-" + hostname)
# verify new hostname name
b.wait_in_text(".pf-c-alert__title", "Running on new-" + hostname)
From 09823650e222da09ab054e10e910af2c804fe1ef Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Thu, 4 Mar 2021 07:40:35 +0100
Subject: [PATCH 203/942] Add FMF test metadata and scripts
Copy and adjust the browser.sh and run-test.sh scripts from
cockpit-podman, which we have used in Fedora/RHEL dist-git gating and
packit tests for a while.
---
.fmf/version | 1 +
plans/all.fmf | 6 +++++
test/browser/browser.sh | 56 ++++++++++++++++++++++++++++++++++++++++
test/browser/main.fmf | 13 ++++++++++
test/browser/run-test.sh | 25 ++++++++++++++++++
5 files changed, 101 insertions(+)
create mode 100644 .fmf/version
create mode 100644 plans/all.fmf
create mode 100755 test/browser/browser.sh
create mode 100644 test/browser/main.fmf
create mode 100755 test/browser/run-test.sh
diff --git a/.fmf/version b/.fmf/version
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/.fmf/version
@@ -0,0 +1 @@
+1
diff --git a/plans/all.fmf b/plans/all.fmf
new file mode 100644
index 0000000..2bce34a
--- /dev/null
+++ b/plans/all.fmf
@@ -0,0 +1,6 @@
+summary:
+ Run all tests
+discover:
+ how: fmf
+execute:
+ how: tmt
diff --git a/test/browser/browser.sh b/test/browser/browser.sh
new file mode 100755
index 0000000..7457dc9
--- /dev/null
+++ b/test/browser/browser.sh
@@ -0,0 +1,56 @@
+#!/bin/sh
+set -eux
+
+TESTS="$(realpath $(dirname "$0"))"
+if [ -d source ]; then
+ # path for standard-test-source
+ SOURCE="$(pwd)/source"
+else
+ SOURCE="$(realpath $TESTS/../..)"
+fi
+LOGS="$(pwd)/logs"
+mkdir -p "$LOGS"
+chmod a+w "$LOGS"
+
+# install browser; on RHEL, use chromium from epel
+# HACK: chromium-headless ought to be enough, but version 88 has a crash: https://bugs.chromium.org/p/chromium/issues/detail?id=1170634
+if ! rpm -q chromium; then
+ if grep -q 'ID=.*rhel' /etc/os-release; then
+ dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
+ dnf config-manager --enable epel
+ fi
+ dnf install -y chromium
+fi
+
+# create user account for logging in
+if ! id admin 2>/dev/null; then
+ useradd -c Administrator -G wheel admin
+ echo admin:foobar | chpasswd
+fi
+
+# set root's password
+echo root:foobar | chpasswd
+
+# avoid sudo lecture during tests
+su -c 'echo foobar | sudo --stdin whoami' - admin
+
+# create user account for running the test
+if ! id runtest 2>/dev/null; then
+ useradd -c 'Test runner' runtest
+ # allow test to set up things on the machine
+ mkdir -p /root/.ssh
+ curl https://raw.githubusercontent.com/cockpit-project/bots/master/machine/identity.pub >> /root/.ssh/authorized_keys
+ chmod 600 /root/.ssh/authorized_keys
+fi
+chown -R runtest "$SOURCE"
+
+# disable core dumps, we rather investigate them upstream where test VMs are accessible
+echo core > /proc/sys/kernel/core_pattern
+
+systemctl enable --now cockpit.socket
+
+# Run tests as unprivileged user
+su - -c "env SOURCE=$SOURCE LOGS=$LOGS $TESTS/run-test.sh" runtest
+
+RC=$(cat $LOGS/exitcode)
+exit ${RC:-1}
diff --git a/test/browser/main.fmf b/test/browser/main.fmf
new file mode 100644
index 0000000..ea9acb6
--- /dev/null
+++ b/test/browser/main.fmf
@@ -0,0 +1,13 @@
+summary:
+ Run browser integration tests on the host
+require:
+ - cockpit-starter-kit
+ - cockpit-ws
+ - cockpit-system
+ - git
+ - libvirt-python3
+ - make
+ - npm
+ - python3
+test: ./browser.sh
+duration: 60m
diff --git a/test/browser/run-test.sh b/test/browser/run-test.sh
new file mode 100755
index 0000000..a3c7585
--- /dev/null
+++ b/test/browser/run-test.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+set -eux
+
+# tests need cockpit's bots/ libraries and test infrastructure
+cd $SOURCE
+git init
+make bots test/common
+
+# only install a subset to save time/space
+rm -f package-lock.json # otherwise the command below installs *everything*, argh
+npm install chrome-remote-interface sizzle
+
+. /etc/os-release
+export TEST_OS="${ID}-${VERSION_ID/./-}"
+export TEST_AUDIT_NO_SELINUX=1
+
+EXCLUDES=""
+
+RC=0
+test/common/run-tests --nondestructive --machine 127.0.0.1:22 --browser 127.0.0.1:9090 $EXCLUDES || RC=$?
+
+echo $RC > "$LOGS/exitcode"
+cp --verbose Test* "$LOGS" || true
+# deliver test result via exitcode file
+exit 0
From a26f4048c28bc96c5c329b018f3b502a189958e2 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Thu, 4 Mar 2021 07:30:37 +0100
Subject: [PATCH 204/942] packit: Enable RPM builds and Fedora testing
Teach `make dist-gzip` to print the tarball name as last line, and use
it as `create-archive` action.
Add a `make print-version` command which packit can use. The builtin
default only works if there is at least one git tag, which is not the
case for starter-kit (which is never released).
---
Makefile | 6 +++++-
README.md | 10 ++++++++++
packit.yaml | 19 +++++++++++++++++++
3 files changed, 34 insertions(+), 1 deletion(-)
create mode 100644 packit.yaml
diff --git a/Makefile b/Makefile
index fde1e12..dfc75c7 100644
--- a/Makefile
+++ b/Makefile
@@ -75,7 +75,11 @@ devel-install: $(WEBPACK_TEST)
mkdir -p ~/.local/share/cockpit
ln -s `pwd`/dist ~/.local/share/cockpit/$(PACKAGE_NAME)
+print-version:
+ @echo "$(VERSION)"
+
dist-gzip: $(TARFILE)
+ @ls -1 $(TARFILE)
# when building a distribution tarball, call webpack with a 'production' environment
# we don't ship node_modules for license and compactness reasons; we ship a
@@ -162,4 +166,4 @@ $(NODE_MODULES_TEST): package.json
env -u NODE_ENV npm install
env -u NODE_ENV npm prune
-.PHONY: all clean install devel-install dist-gzip srpm rpm check vm update-po
+.PHONY: all clean install devel-install print-version dist-gzip srpm rpm check vm update-po
diff --git a/README.md b/README.md
index 8a52ec3..52aec3f 100644
--- a/README.md
+++ b/README.md
@@ -93,6 +93,16 @@ operating systems (Fedora and CentOS 8). Note that if/once your project grows
bigger, or gets frequent changes, you may need to move to a paid account, or
different infrastructure with more capacity.
+Tests also run in [Packit](https://packit.dev/) for all currently supported
+Fedora releases; see the [packit.yaml](./packit.yaml) control file. You need to
+[enable Packit-as-a-service](https://packit.dev/docs/packit-as-a-service/) in your GitHub project to use this.
+To run the tests in the exact same way for upstream pull requests and for
+[Fedora package update gating](https://docs.fedoraproject.org/en-US/ci/), the
+tests are wrapped in the [FMF metadata format](https://github.com/psss/fmf)
+for using with the [tmt test management tool](https://docs.fedoraproject.org/en-US/ci/tmt/).
+Note that Packit tests can *not* run their own virtual machine images, thus
+they only run [@nondestructive tests](https://github.com/martinpitt/cockpit/blob/master/test/common/testlib.py).
+
# Customizing
After cloning the Starter Kit you should rename the files, package names, and
diff --git a/packit.yaml b/packit.yaml
new file mode 100644
index 0000000..b5cdb0f
--- /dev/null
+++ b/packit.yaml
@@ -0,0 +1,19 @@
+# Enable RPM builds and running integration tests in PRs through https://packit.dev/
+# To use this, enable Packit-as-a-service in GitHub: https://packit.dev/docs/packit-as-a-service/
+# See https://packit.dev/docs/configuration/ for the format of this file
+
+specfile_path: cockpit-starter-kit.spec
+actions:
+ post-upstream-clone: make cockpit-starter-kit.spec
+ # reduce memory consumption of webpack in sandcastle container
+ # https://github.com/packit/sandcastle/pull/92
+ # https://medium.com/the-node-js-collection/node-js-memory-management-in-container-environments-7eb8409a74e8
+ create-archive: make NODE_OPTIONS=--max-old-space-size=500 dist-gzip
+ # starter-kit.git has no release tags; your project can drop this once you have a release
+ get-current-version: make print-version
+jobs:
+ - job: tests
+ trigger: pull_request
+ metadata:
+ targets:
+ - fedora-all
From 957e7f157c84f25030e039bcc2ed128784eb571a Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Wed, 10 Mar 2021 02:37:39 +0000
Subject: [PATCH 205/942] package.json: Update @patternfly/react-core,
@patternfly/patternfly
Closes #434
---
package.json | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/package.json b/package.json
index 30f95ce..a3017d4 100644
--- a/package.json
+++ b/package.json
@@ -46,8 +46,8 @@
"webpack-cli": "^3.3.5"
},
"dependencies": {
- "@patternfly/patternfly": "4.87.3",
- "@patternfly/react-core": "4.97.2",
+ "@patternfly/patternfly": "4.90.5",
+ "@patternfly/react-core": "4.101.3",
"core-js": "3.9.1",
"react": "16.14.0",
"react-dom": "16.14.0"
From 58cfb84de29686b177395d445cbb59b40931e87e Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Thu, 1 Apr 2021 02:29:26 +0000
Subject: [PATCH 206/942] package.json: Update @patternfly/react-core,
@patternfly/patternfly
Closes #441
---
package.json | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/package.json b/package.json
index a3017d4..8e9f690 100644
--- a/package.json
+++ b/package.json
@@ -46,8 +46,8 @@
"webpack-cli": "^3.3.5"
},
"dependencies": {
- "@patternfly/patternfly": "4.90.5",
- "@patternfly/react-core": "4.101.3",
+ "@patternfly/patternfly": "4.96.2",
+ "@patternfly/react-core": "4.106.1",
"core-js": "3.9.1",
"react": "16.14.0",
"react-dom": "16.14.0"
From 28d6b456cbb403a59e4276dae89b24dd76d6c3df Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Fri, 2 Apr 2021 02:30:56 +0000
Subject: [PATCH 207/942] package.json: Update @patternfly/react-core
Closes #442
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 8e9f690..22f4dc1 100644
--- a/package.json
+++ b/package.json
@@ -47,7 +47,7 @@
},
"dependencies": {
"@patternfly/patternfly": "4.96.2",
- "@patternfly/react-core": "4.106.1",
+ "@patternfly/react-core": "4.106.2",
"core-js": "3.9.1",
"react": "16.14.0",
"react-dom": "16.14.0"
From a8eeeefd58afb2b95e37e1ac3639fc32d1cfdbac Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Sat, 3 Apr 2021 02:25:22 +0000
Subject: [PATCH 208/942] package.json: Update core-js
Closes #443
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 22f4dc1..0a42e5d 100644
--- a/package.json
+++ b/package.json
@@ -48,7 +48,7 @@
"dependencies": {
"@patternfly/patternfly": "4.96.2",
"@patternfly/react-core": "4.106.2",
- "core-js": "3.9.1",
+ "core-js": "3.10.0",
"react": "16.14.0",
"react-dom": "16.14.0"
}
From 70351d90817790b09a54c48a6320b5fe4b5ffc68 Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Thu, 8 Apr 2021 02:29:00 +0000
Subject: [PATCH 209/942] package.json: Update core-js
Closes #444
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 0a42e5d..051cbd8 100644
--- a/package.json
+++ b/package.json
@@ -48,7 +48,7 @@
"dependencies": {
"@patternfly/patternfly": "4.96.2",
"@patternfly/react-core": "4.106.2",
- "core-js": "3.10.0",
+ "core-js": "3.10.1",
"react": "16.14.0",
"react-dom": "16.14.0"
}
From 1744ec2f5dad017272bfe1723dfd020c9ebcb157 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Fri, 9 Apr 2021 07:59:04 +0200
Subject: [PATCH 210/942] Ignore src/lib for eslint
This code comes from cockpit.git. Newer ESLint versions have a lot of
complaints about it, but in starter-kit we can't do anything about these
directly. Let's keep the stricter ESLint settings instead of ignoring a
lot more warnings to cover src/lib.
---
.eslintignore | 1 +
1 file changed, 1 insertion(+)
diff --git a/.eslintignore b/.eslintignore
index 8d87b1d..8faa0e3 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -1 +1,2 @@
node_modules/*
+src/lib/*
From 04d6c566c77b58f0f087bee9a8ad33c4193d1762 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Fri, 9 Apr 2021 08:03:58 +0200
Subject: [PATCH 211/942] eslint: Drop some disabled but desirable warnings
Project authors can/should decide about these by themselves.
---
.eslintrc.json | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/.eslintrc.json b/.eslintrc.json
index e660dc9..05bf33b 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -42,12 +42,7 @@
"react/jsx-indent-props": "off",
"react/prop-types": "off",
"space-before-function-paren": "off",
- "standard/no-callback-literal": "off",
-
- "eqeqeq": "off",
- "import/no-webpack-loader-syntax": "off",
- "object-property-newline": "off",
- "react/jsx-no-bind": "off"
+ "standard/no-callback-literal": "off"
},
"globals": {
"require": false,
From e449e945646ec673b84f8375f486645864b79664 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Fri, 9 Apr 2021 08:06:00 +0200
Subject: [PATCH 212/942] Move babel config into separate file
This works better with the current eslint loader, as then eslint and
babel can look at the same configuration. See
.
This is similar to .eslintrc.json.
---
.babelrc.json | 14 ++++++++++++++
webpack.config.js | 21 +--------------------
2 files changed, 15 insertions(+), 20 deletions(-)
create mode 100644 .babelrc.json
diff --git a/.babelrc.json b/.babelrc.json
new file mode 100644
index 0000000..dfe57f2
--- /dev/null
+++ b/.babelrc.json
@@ -0,0 +1,14 @@
+{
+ "presets": [
+ ["@babel/env", {
+ "targets": {
+ "chrome": "57",
+ "firefox": "52",
+ "safari": "10.3",
+ "edge": "16",
+ "opera": "44"
+ }
+ }],
+ "@babel/preset-react"
+ ]
+}
diff --git a/webpack.config.js b/webpack.config.js
index f02c0b9..00295cb 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -35,25 +35,6 @@ if (production) {
}));
}
-/* keep this in sync with cockpit.git */
-const babel_loader = {
- loader: "babel-loader",
- options: {
- presets: [
- ["@babel/env", {
- "targets": {
- "chrome": "57",
- "firefox": "52",
- "safari": "10.3",
- "edge": "16",
- "opera": "44"
- }
- }],
- "@babel/preset-react"
- ]
- }
-}
-
/* check if sassc is available, to avoid unintelligible error messages */
try {
childProcess.execFileSync('sassc', ['--version'], { stdio: ['pipe', 'inherit', 'inherit'] });
@@ -100,7 +81,7 @@ module.exports = {
},
{
exclude: /node_modules/,
- use: babel_loader,
+ use: "babel-loader",
test: /\.(js|jsx)$/
},
/* HACK: remove unwanted fonts from PatternFly's css */
From 0e608d562a04195ec9d5197ea2b0a5a1149d046f Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Fri, 9 Apr 2021 08:10:54 +0200
Subject: [PATCH 213/942] Use current babel/eslint integration
Fixes these `npm install` warnings:
> deprecated babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
> deprecated eslint-loader@4.0.2: This loader has been deprecated. Please use eslint-webpack-plugin
---
.eslintrc.json | 2 +-
package.json | 4 ++--
webpack.config.js | 8 ++------
3 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/.eslintrc.json b/.eslintrc.json
index 05bf33b..4572422 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -5,7 +5,7 @@
"es6": true
},
"extends": ["eslint:recommended", "standard", "standard-react"],
- "parser": "babel-eslint",
+ "parser": "@babel/eslint-parser",
"parserOptions": {
"ecmaVersion": "7",
"ecmaFeatures": {
diff --git a/package.json b/package.json
index 051cbd8..e4945eb 100644
--- a/package.json
+++ b/package.json
@@ -13,9 +13,9 @@
},
"devDependencies": {
"@babel/core": "^7.5.4",
+ "@babel/eslint-parser": "^7.13.14",
"@babel/preset-env": "^7.5.4",
"@babel/preset-react": "^7.0.0",
- "babel-eslint": "^10.0.3",
"babel-loader": "^8.0.6",
"chrome-remote-interface": "^0.28.0",
"compression-webpack-plugin": "^6.0.0",
@@ -24,7 +24,6 @@
"eslint": "^7.10.0",
"eslint-config-standard": "^14.1.1",
"eslint-config-standard-react": "^9.2.0",
- "eslint-loader": "^4.0.2",
"eslint-plugin-flowtype": "^5.2.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-node": "^11.1.0",
@@ -32,6 +31,7 @@
"eslint-plugin-react": "^7.21.2",
"eslint-plugin-react-hooks": "^4.1.2",
"eslint-plugin-standard": "^4.0.1",
+ "eslint-webpack-plugin": "^2.5.3",
"htmlparser": "^1.7.7",
"jed": "^1.1.1",
"mini-css-extract-plugin": "^0.11.0",
diff --git a/webpack.config.js b/webpack.config.js
index 00295cb..6f556bc 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -6,6 +6,7 @@ const extract = require("mini-css-extract-plugin");
const TerserJSPlugin = require('terser-webpack-plugin');
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const CompressionPlugin = require("compression-webpack-plugin");
+const ESLintPlugin = require('eslint-webpack-plugin');
const CockpitPoPlugin = require("./src/lib/cockpit-po-plugin");
const webpack = require("webpack");
@@ -24,6 +25,7 @@ const copy_files = [
const plugins = [
new copy({ patterns: copy_files }),
new extract({filename: "[name].css"}),
+ new ESLintPlugin({ extensions: ["js", "jsx"] }),
new CockpitPoPlugin(),
];
@@ -73,12 +75,6 @@ module.exports = {
module: {
rules: [
- {
- enforce: 'pre',
- exclude: /node_modules/,
- loader: 'eslint-loader',
- test: /\.(js|jsx)$/
- },
{
exclude: /node_modules/,
use: "babel-loader",
From 45b8c2a45afd5fcff88cba54ffd79d58ecb60cbf Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Thu, 8 Apr 2021 10:28:34 +0200
Subject: [PATCH 214/942] spec: Don't fail if there are no map files
---
cockpit-starter-kit.spec.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cockpit-starter-kit.spec.in b/cockpit-starter-kit.spec.in
index 8447cfe..f73012f 100644
--- a/cockpit-starter-kit.spec.in
+++ b/cockpit-starter-kit.spec.in
@@ -24,7 +24,7 @@ Cockpit Starter Kit Example Module
appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/metainfo/*
# drop source maps, they are large and just for debugging
-find %{buildroot}%{_datadir}/cockpit/ -name '*.map' | xargs rm --verbose
+find %{buildroot}%{_datadir}/cockpit/ -name '*.map' | xargs --no-run-if-empty rm --verbose
%files
%{_datadir}/cockpit/*
From c52136c051448463af5a9e869c332f0d8e0ffca0 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Thu, 8 Apr 2021 10:07:50 +0200
Subject: [PATCH 215/942] Move to webpack 5
We don't need to explicitly mention TerserJSPlugin any more (from commit
6b8611), as webpack 5 can now extend the `minimizer:` list with the
special `...` syntax.
This gets rid of several `npm install` warnings:
deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
as well as 10 MB of node_modules.
---
package.json | 9 ++++-----
webpack.config.js | 5 ++---
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/package.json b/package.json
index e4945eb..04686d9 100644
--- a/package.json
+++ b/package.json
@@ -21,6 +21,7 @@
"compression-webpack-plugin": "^6.0.0",
"copy-webpack-plugin": "^6.1.0",
"css-loader": "^4.3.0",
+ "css-minimizer-webpack-plugin": "^1.3.0",
"eslint": "^7.10.0",
"eslint-config-standard": "^14.1.1",
"eslint-config-standard-react": "^9.2.0",
@@ -35,15 +36,13 @@
"htmlparser": "^1.7.7",
"jed": "^1.1.1",
"mini-css-extract-plugin": "^0.11.0",
- "optimize-css-assets-webpack-plugin": "^5.0.3",
"po2json": "^1.0.0-alpha",
"qunit": "^2.9.3",
"sizzle": "^2.3.3",
"stdio": "^2.1.0",
- "string-replace-loader": "^2.3.0",
- "terser-webpack-plugin": "^2.0.1",
- "webpack": "^4.35.3",
- "webpack-cli": "^3.3.5"
+ "string-replace-loader": "^3.0.0",
+ "webpack": "^5.31.0",
+ "webpack-cli": "^4.6.0"
},
"dependencies": {
"@patternfly/patternfly": "4.96.2",
diff --git a/webpack.config.js b/webpack.config.js
index 6f556bc..46daef5 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -3,8 +3,7 @@ const childProcess = require('child_process');
const copy = require("copy-webpack-plugin");
const extract = require("mini-css-extract-plugin");
-const TerserJSPlugin = require('terser-webpack-plugin');
-const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
+const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
const CompressionPlugin = require("compression-webpack-plugin");
const ESLintPlugin = require('eslint-webpack-plugin');
const CockpitPoPlugin = require("./src/lib/cockpit-po-plugin");
@@ -70,7 +69,7 @@ module.exports = {
optimization: {
minimize: production,
- minimizer: [new TerserJSPlugin({}), new OptimizeCSSAssetsPlugin({})],
+ minimizer: [`...`, new CssMinimizerPlugin()],
},
module: {
From 2624dbb89143272014adae620668c711639fb86d Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Fri, 9 Apr 2021 16:10:40 +0200
Subject: [PATCH 216/942] Build and ship LICENSE file
Bring back terser-webpack-plugin from commit c52136c051448 and re-enable
it. It builds the autogenerated dist/index.js.LICENSE.txt which is quite
important for shipping distribution packages -- c-{podman,machines} both
do this.
Backport https://github.com/cockpit-project/cockpit-podman/commit/95021c336ed
to make sure that the webpack for the release tarball is *actually*
built in production mode.
---
Makefile | 2 +-
cockpit-starter-kit.spec.in | 2 ++
package.json | 1 +
webpack.config.js | 3 ++-
4 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index dfc75c7..1a7c91b 100644
--- a/Makefile
+++ b/Makefile
@@ -85,7 +85,7 @@ dist-gzip: $(TARFILE)
# we don't ship node_modules for license and compactness reasons; we ship a
# pre-built dist/ (so it's not necessary) and ship packge-lock.json (so that
# node_modules/ can be reconstructed if necessary)
-$(TARFILE): NODE_ENV=production
+$(TARFILE): export NODE_ENV=production
$(TARFILE): $(WEBPACK_TEST) cockpit-$(PACKAGE_NAME).spec
if type appstream-util >/dev/null 2>&1; then appstream-util validate-relax --nonet *.metainfo.xml; fi
mv node_modules node_modules.release
diff --git a/cockpit-starter-kit.spec.in b/cockpit-starter-kit.spec.in
index f73012f..32520fd 100644
--- a/cockpit-starter-kit.spec.in
+++ b/cockpit-starter-kit.spec.in
@@ -27,6 +27,8 @@ appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/metainfo/*
find %{buildroot}%{_datadir}/cockpit/ -name '*.map' | xargs --no-run-if-empty rm --verbose
%files
+%doc README.md
+%license LICENSE dist/index.js.LICENSE.txt
%{_datadir}/cockpit/*
%{_datadir}/metainfo/*
diff --git a/package.json b/package.json
index 04686d9..93c11cd 100644
--- a/package.json
+++ b/package.json
@@ -41,6 +41,7 @@
"sizzle": "^2.3.3",
"stdio": "^2.1.0",
"string-replace-loader": "^3.0.0",
+ "terser-webpack-plugin": "^2.0.1",
"webpack": "^5.31.0",
"webpack-cli": "^4.6.0"
},
diff --git a/webpack.config.js b/webpack.config.js
index 46daef5..e2caf5f 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -3,6 +3,7 @@ const childProcess = require('child_process');
const copy = require("copy-webpack-plugin");
const extract = require("mini-css-extract-plugin");
+const TerserJSPlugin = require('terser-webpack-plugin');
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
const CompressionPlugin = require("compression-webpack-plugin");
const ESLintPlugin = require('eslint-webpack-plugin');
@@ -69,7 +70,7 @@ module.exports = {
optimization: {
minimize: production,
- minimizer: [`...`, new CssMinimizerPlugin()],
+ minimizer: [new TerserJSPlugin(), new CssMinimizerPlugin()],
},
module: {
From d02579694d34a30a1c6c98a151407ffd14363bd0 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Mon, 19 Apr 2021 09:06:10 +0200
Subject: [PATCH 217/942] test: Adjust to language selector change in Cockpit
242
See https://github.com/cockpit-project/cockpit/commit/bf1f645208
---
test/check-application | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/test/check-application b/test/check-application
index 60e545c..4227c2d 100755
--- a/test/check-application
+++ b/test/check-application
@@ -38,9 +38,12 @@ class TestApplication(testlib.MachineCase):
b.click("#navbar-dropdown")
b.click(".display-language-menu a")
b.wait_popup('display-language')
- # the dialog changed in cockpit 233
+ # the dialog changed several times
cockpit_version = float(m.execute("cockpit-bridge --version | sed -n '/Version:/ s/^.*: //p'").strip())
- if cockpit_version >= 233:
+ if cockpit_version >= 242:
+ b.click("#display-language-modal [data-value='de-de'] button")
+ b.click("#display-language-modal button.pf-m-primary")
+ elif cockpit_version >= 233:
b.set_val("#display-language-modal select", "de-de")
b.click("#display-language-modal button.pf-m-primary")
else:
From b5610000b538d57a080ccac37cbb9398a0d47b03 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Mon, 19 Apr 2021 10:12:44 +0200
Subject: [PATCH 218/942] fmf: Add glibc-langpack-de test dependency
The tests switch to German, make sure that the corresponding locale
exists. Otherwise, tests will run into unexpected messages like "invalid
or unusable locale: de_DE.UTF-8".
---
test/browser/main.fmf | 1 +
1 file changed, 1 insertion(+)
diff --git a/test/browser/main.fmf b/test/browser/main.fmf
index ea9acb6..a08584c 100644
--- a/test/browser/main.fmf
+++ b/test/browser/main.fmf
@@ -5,6 +5,7 @@ require:
- cockpit-ws
- cockpit-system
- git
+ - glibc-langpack-de
- libvirt-python3
- make
- npm
From 180a48caaaab33c1a124803a3b927675448af4f2 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Mon, 19 Apr 2021 08:32:12 +0200
Subject: [PATCH 219/942] Bump cockpit test/common and lib to 242
https://github.com/martinpitt/cockpit/commit/731fdf82c0 fixed the
deprecation warning in cockpit-po-plugin:
> node:37175) [DEP_WEBPACK_COMPILATION_ASSETS] DeprecationWarning:
> Compilation.assets will be frozen in future, all modifications are
> deprecated.
> BREAKING CHANGE: No more changes should happen to Compilation.assets
> after sealing the Compilation.
---
Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 1a7c91b..2bb5dfb 100644
--- a/Makefile
+++ b/Makefile
@@ -147,14 +147,14 @@ bots:
# when you start a new project, use the latest release, and update it from time to time
test/common:
flock Makefile sh -ec '\
- git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 239; \
+ git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 242; \
git checkout --force FETCH_HEAD -- test/common; \
git reset test/common'
# checkout Cockpit's PF/React/build library; again this has no API stability guarantee, so check out a stable tag
$(LIB_TEST):
flock Makefile sh -ec '\
- git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 238; \
+ git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 242; \
git checkout --force FETCH_HEAD -- pkg/lib; \
git reset -- pkg/lib'
mv pkg/lib src/ && rmdir -p pkg
From 1d7aad7c5292bf860f72a24d7eaaaba8f594d8ae Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Tue, 20 Apr 2021 02:24:13 +0000
Subject: [PATCH 220/942] package.json: Update core-js
Closes #450
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 93c11cd..118d40c 100644
--- a/package.json
+++ b/package.json
@@ -48,7 +48,7 @@
"dependencies": {
"@patternfly/patternfly": "4.96.2",
"@patternfly/react-core": "4.106.2",
- "core-js": "3.10.1",
+ "core-js": "3.10.2",
"react": "16.14.0",
"react-dom": "16.14.0"
}
From 6356bc70b270effc372c02a97afadbb5db47e6a2 Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Thu, 22 Apr 2021 02:25:39 +0000
Subject: [PATCH 221/942] package.json: Update @patternfly/react-core,
@patternfly/patternfly
Closes #451
---
package.json | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/package.json b/package.json
index 118d40c..4ad4f69 100644
--- a/package.json
+++ b/package.json
@@ -46,8 +46,8 @@
"webpack-cli": "^4.6.0"
},
"dependencies": {
- "@patternfly/patternfly": "4.96.2",
- "@patternfly/react-core": "4.106.2",
+ "@patternfly/patternfly": "4.102.1",
+ "@patternfly/react-core": "4.115.1",
"core-js": "3.10.2",
"react": "16.14.0",
"react-dom": "16.14.0"
From 178ad4bc9e416d6e83b586845b03f68997b540ba Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Fri, 23 Apr 2021 02:29:26 +0000
Subject: [PATCH 222/942] package.json: Update core-js
Closes #452
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 4ad4f69..be57c80 100644
--- a/package.json
+++ b/package.json
@@ -48,7 +48,7 @@
"dependencies": {
"@patternfly/patternfly": "4.102.1",
"@patternfly/react-core": "4.115.1",
- "core-js": "3.10.2",
+ "core-js": "3.11.0",
"react": "16.14.0",
"react-dom": "16.14.0"
}
From 702712355c30eb0f88b85ac2f8bc82aab6015d04 Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Sat, 24 Apr 2021 02:26:57 +0000
Subject: [PATCH 223/942] package.json: Update @patternfly/patternfly,
@patternfly/react-core
Closes #453
---
package.json | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/package.json b/package.json
index be57c80..5c88e5a 100644
--- a/package.json
+++ b/package.json
@@ -46,8 +46,8 @@
"webpack-cli": "^4.6.0"
},
"dependencies": {
- "@patternfly/patternfly": "4.102.1",
- "@patternfly/react-core": "4.115.1",
+ "@patternfly/patternfly": "4.102.2",
+ "@patternfly/react-core": "4.115.2",
"core-js": "3.11.0",
"react": "16.14.0",
"react-dom": "16.14.0"
From 1b5f96e9dca84f3287d507690ec2a2239e962895 Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Thu, 29 Apr 2021 02:24:55 +0000
Subject: [PATCH 224/942] package.json: Update core-js
Closes #454
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 5c88e5a..b5301f9 100644
--- a/package.json
+++ b/package.json
@@ -48,7 +48,7 @@
"dependencies": {
"@patternfly/patternfly": "4.102.2",
"@patternfly/react-core": "4.115.2",
- "core-js": "3.11.0",
+ "core-js": "3.11.1",
"react": "16.14.0",
"react-dom": "16.14.0"
}
From a29384eebd50e8ade10b32a197f29e213ae54ad1 Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Tue, 4 May 2021 02:44:18 +0000
Subject: [PATCH 225/942] package.json: Update core-js
Closes #455
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index b5301f9..44d41f9 100644
--- a/package.json
+++ b/package.json
@@ -48,7 +48,7 @@
"dependencies": {
"@patternfly/patternfly": "4.102.2",
"@patternfly/react-core": "4.115.2",
- "core-js": "3.11.1",
+ "core-js": "3.11.2",
"react": "16.14.0",
"react-dom": "16.14.0"
}
From f4d2ee2ecc69dd2fd06752d6e1df645bed69efc8 Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Thu, 6 May 2021 02:42:21 +0000
Subject: [PATCH 226/942] package.json: Update core-js
Closes #456
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 44d41f9..e997bfe 100644
--- a/package.json
+++ b/package.json
@@ -48,7 +48,7 @@
"dependencies": {
"@patternfly/patternfly": "4.102.2",
"@patternfly/react-core": "4.115.2",
- "core-js": "3.11.2",
+ "core-js": "3.11.3",
"react": "16.14.0",
"react-dom": "16.14.0"
}
From 53455d58b3e49141b4b74158913268af2b91fcc4 Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Fri, 7 May 2021 02:47:25 +0000
Subject: [PATCH 227/942] package.json: Update core-js
Closes #457
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index e997bfe..7479bf5 100644
--- a/package.json
+++ b/package.json
@@ -48,7 +48,7 @@
"dependencies": {
"@patternfly/patternfly": "4.102.2",
"@patternfly/react-core": "4.115.2",
- "core-js": "3.11.3",
+ "core-js": "3.12.0",
"react": "16.14.0",
"react-dom": "16.14.0"
}
From a10984bcf08156a936224bbd3f4e0451c4d25729 Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Sun, 9 May 2021 02:44:55 +0000
Subject: [PATCH 228/942] package.json: Update core-js
Closes #458
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 7479bf5..34f4170 100644
--- a/package.json
+++ b/package.json
@@ -48,7 +48,7 @@
"dependencies": {
"@patternfly/patternfly": "4.102.2",
"@patternfly/react-core": "4.115.2",
- "core-js": "3.12.0",
+ "core-js": "3.12.1",
"react": "16.14.0",
"react-dom": "16.14.0"
}
From 22edb6591ba0bfed2dba38adde87979b10f0994a Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Wed, 19 May 2021 02:48:50 +0000
Subject: [PATCH 229/942] package.json: Update @patternfly/react-core,
@patternfly/patternfly
Closes #459
---
package.json | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/package.json b/package.json
index 34f4170..290152f 100644
--- a/package.json
+++ b/package.json
@@ -46,8 +46,8 @@
"webpack-cli": "^4.6.0"
},
"dependencies": {
- "@patternfly/patternfly": "4.102.2",
- "@patternfly/react-core": "4.115.2",
+ "@patternfly/patternfly": "4.103.6",
+ "@patternfly/react-core": "4.121.1",
"core-js": "3.12.1",
"react": "16.14.0",
"react-dom": "16.14.0"
From 09bc3dca4c6624ce8ef3710b1d660b824a24989f Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Wed, 26 May 2021 03:36:09 +0000
Subject: [PATCH 230/942] package.json: Update core-js
Closes #460
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 290152f..9b558e7 100644
--- a/package.json
+++ b/package.json
@@ -48,7 +48,7 @@
"dependencies": {
"@patternfly/patternfly": "4.103.6",
"@patternfly/react-core": "4.121.1",
- "core-js": "3.12.1",
+ "core-js": "3.13.0",
"react": "16.14.0",
"react-dom": "16.14.0"
}
From 261922a9c1f5a900ba7d696637f19e2c1a2582c4 Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Sun, 30 May 2021 04:48:39 +0000
Subject: [PATCH 231/942] package.json: Update core-js
Closes #462
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 9b558e7..736a613 100644
--- a/package.json
+++ b/package.json
@@ -48,7 +48,7 @@
"dependencies": {
"@patternfly/patternfly": "4.103.6",
"@patternfly/react-core": "4.121.1",
- "core-js": "3.13.0",
+ "core-js": "3.13.1",
"react": "16.14.0",
"react-dom": "16.14.0"
}
From 0edc3e6c53805194e1413a9a918bb0076e44fce8 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Sun, 30 May 2021 19:49:06 +0200
Subject: [PATCH 232/942] packit: Build in development mode
With recent NPM/sandcastle versions, production mode and its additional
optimizations don't fit any more into the 768 MB RAM of sandcastle
containers. Build in development mode, which skips the optimization
steps.
Taken from https://github.com/cockpit-project/cockpit-podman/commit/7000b4460e6ac
---
packit.yaml | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/packit.yaml b/packit.yaml
index b5cdb0f..33ec1ab 100644
--- a/packit.yaml
+++ b/packit.yaml
@@ -5,10 +5,15 @@
specfile_path: cockpit-starter-kit.spec
actions:
post-upstream-clone: make cockpit-starter-kit.spec
- # reduce memory consumption of webpack in sandcastle container
+ # build in development mode; production mode uses too much memory for limited
+ # sandcastle containers; also reduce memory consumption of webpack
# https://github.com/packit/sandcastle/pull/92
# https://medium.com/the-node-js-collection/node-js-memory-management-in-container-environments-7eb8409a74e8
- create-archive: make NODE_OPTIONS=--max-old-space-size=500 dist-gzip
+ create-archive:
+ - make NODE_ENV=development NODE_OPTIONS=--max-old-space-size=500
+ # dummy LICENSE.txt, as terser did not run
+ - touch dist/index.js.LICENSE.txt
+ - make dist-gzip
# starter-kit.git has no release tags; your project can drop this once you have a release
get-current-version: make print-version
jobs:
From efce4f7f95115ec5b9e0a3464f0a233c28a57682 Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Sun, 6 Jun 2021 03:42:06 +0000
Subject: [PATCH 233/942] package.json: Update core-js
Closes #464
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 736a613..6a32664 100644
--- a/package.json
+++ b/package.json
@@ -48,7 +48,7 @@
"dependencies": {
"@patternfly/patternfly": "4.103.6",
"@patternfly/react-core": "4.121.1",
- "core-js": "3.13.1",
+ "core-js": "3.14.0",
"react": "16.14.0",
"react-dom": "16.14.0"
}
From caf8e908ebc0ef6953883f63338b3a6996472152 Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Wed, 9 Jun 2021 02:54:09 +0000
Subject: [PATCH 234/942] package.json: Update @patternfly/patternfly,
@patternfly/react-core
Closes #465
---
package.json | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/package.json b/package.json
index 6a32664..cbd1661 100644
--- a/package.json
+++ b/package.json
@@ -46,8 +46,8 @@
"webpack-cli": "^4.6.0"
},
"dependencies": {
- "@patternfly/patternfly": "4.103.6",
- "@patternfly/react-core": "4.121.1",
+ "@patternfly/patternfly": "4.108.2",
+ "@patternfly/react-core": "4.128.2",
"core-js": "3.14.0",
"react": "16.14.0",
"react-dom": "16.14.0"
From 7ddabca32a0d6a979e2858b51b3ee6577d4bdd5f Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Mon, 21 Jun 2021 02:40:25 +0000
Subject: [PATCH 235/942] package.json: Update core-js
Closes #467
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index cbd1661..a0f6785 100644
--- a/package.json
+++ b/package.json
@@ -48,7 +48,7 @@
"dependencies": {
"@patternfly/patternfly": "4.108.2",
"@patternfly/react-core": "4.128.2",
- "core-js": "3.14.0",
+ "core-js": "3.15.0",
"react": "16.14.0",
"react-dom": "16.14.0"
}
From 835395fc18988cbbd71b9cfe159ac4f36502dc27 Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Thu, 24 Jun 2021 02:22:21 +0000
Subject: [PATCH 236/942] package.json: Update @patternfly/patternfly,
@patternfly/react-core
Closes #468
---
package.json | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/package.json b/package.json
index a0f6785..563ab49 100644
--- a/package.json
+++ b/package.json
@@ -46,8 +46,8 @@
"webpack-cli": "^4.6.0"
},
"dependencies": {
- "@patternfly/patternfly": "4.108.2",
- "@patternfly/react-core": "4.128.2",
+ "@patternfly/patternfly": "4.115.2",
+ "@patternfly/react-core": "4.135.0",
"core-js": "3.15.0",
"react": "16.14.0",
"react-dom": "16.14.0"
From 50ae23e5ad1531084cec2b2fde978dccf192f9b8 Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Fri, 25 Jun 2021 02:35:00 +0000
Subject: [PATCH 237/942] package.json: Update core-js
Closes #470
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 563ab49..5a63378 100644
--- a/package.json
+++ b/package.json
@@ -48,7 +48,7 @@
"dependencies": {
"@patternfly/patternfly": "4.115.2",
"@patternfly/react-core": "4.135.0",
- "core-js": "3.15.0",
+ "core-js": "3.15.1",
"react": "16.14.0",
"react-dom": "16.14.0"
}
From 37a64010bfd0c9df18465802a25ef210c270316d Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Wed, 30 Jun 2021 02:34:41 +0000
Subject: [PATCH 238/942] package.json: Update core-js
Closes #471
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 5a63378..80c09e2 100644
--- a/package.json
+++ b/package.json
@@ -48,7 +48,7 @@
"dependencies": {
"@patternfly/patternfly": "4.115.2",
"@patternfly/react-core": "4.135.0",
- "core-js": "3.15.1",
+ "core-js": "3.15.2",
"react": "16.14.0",
"react-dom": "16.14.0"
}
From 37b2ee5056583cd654f59cc67f6b04643694fa57 Mon Sep 17 00:00:00 2001
From: Allison Karlitskaya
Date: Mon, 5 Jul 2021 09:56:03 +0200
Subject: [PATCH 239/942] =?UTF-8?q?various:=20master=20=E2=86=92=20main=20?=
=?UTF-8?q?updates?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
cockpit/ bots/ and cockpituous/ all use the 'main' branch now.
---
.cirrus.yml | 2 +-
Makefile | 2 +-
README.md | 8 ++++----
cockpituous-release | 4 ++--
test/browser/browser.sh | 2 +-
test/check-application | 2 +-
6 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/.cirrus.yml b/.cirrus.yml
index 4a0c6df..92aabeb 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -1,7 +1,7 @@
container:
# official cockpit CI container, with cockpit related build and test dependencies
# if you want to use your own, see the documentation about required packages:
- # https://github.com/cockpit-project/cockpit/blob/master/HACKING.md#getting-the-development-dependencies
+ # https://github.com/cockpit-project/cockpit/blob/main/HACKING.md#getting-the-development-dependencies
image: quay.io/cockpit/tasks
kvm: true
# increase this if you have many tests that benefit from parallelism
diff --git a/Makefile b/Makefile
index 2bb5dfb..fc61ece 100644
--- a/Makefile
+++ b/Makefile
@@ -136,7 +136,7 @@ check: $(NODE_MODULES_TEST) $(VM_IMAGE) test/common
TEST_AUDIT_NO_SELINUX=1 test/common/run-tests
# checkout Cockpit's bots for standard test VM images and API to launch them
-# must be from master, as only that has current and existing images; but testvm.py API is stable
+# must be from main, as only that has current and existing images; but testvm.py API is stable
# support CI testing against a bots change
bots:
git clone --quiet --reference-if-able $${XDG_CACHE_HOME:-$$HOME/.cache}/cockpit-project/bots https://github.com/cockpit-project/bots.git
diff --git a/README.md b/README.md
index 52aec3f..7b9e3c2 100644
--- a/README.md
+++ b/README.md
@@ -67,7 +67,7 @@ Run `make check` to build an RPM, install it into a standard Cockpit test VM
it. This uses Cockpit's Chrome DevTools Protocol based browser tests, through a
Python API abstraction. Note that this API is not guaranteed to be stable, so
if you run into failures and don't want to adjust tests, consider checking out
-Cockpit's test/common from a tag instead of master (see the `test/common`
+Cockpit's test/common from a tag instead of main (see the `test/common`
target in `Makefile`).
After the test VM is prepared, you can manually run the test without rebuilding
@@ -101,7 +101,7 @@ To run the tests in the exact same way for upstream pull requests and for
tests are wrapped in the [FMF metadata format](https://github.com/psss/fmf)
for using with the [tmt test management tool](https://docs.fedoraproject.org/en-US/ci/tmt/).
Note that Packit tests can *not* run their own virtual machine images, thus
-they only run [@nondestructive tests](https://github.com/martinpitt/cockpit/blob/master/test/common/testlib.py).
+they only run [@nondestructive tests](https://github.com/martinpitt/cockpit/blob/main/test/common/testlib.py).
# Customizing
@@ -115,7 +115,7 @@ change:
# Automated release
Once your cloned project is ready for a release, you should consider automating
-that. [Cockpituous release](https://github.com/cockpit-project/cockpituous/tree/master/release)
+that. [Cockpituous release](https://github.com/cockpit-project/cockpituous/tree/main/release)
aims to fully automate project releases to GitHub, Fedora, Ubuntu, COPR, Docker
Hub, and other places. The intention is that the only manual step for releasing
a project is to create a signed tag for the version number; pushing the tag
@@ -130,7 +130,7 @@ up secrets and run cockpituous.
It is important to keep your [NPM modules](./package.json) up to date, to keep
up with security updates and bug fixes. This is done with the
-[npm-update bot script](https://github.com/cockpit-project/bots/blob/master/npm-update)
+[npm-update bot script](https://github.com/cockpit-project/bots/blob/main/npm-update)
which is run weekly or upon [manual request](https://github.com/cockpit-project/starter-kit/actions) through the
[npm-update.yml](.github/workflows/npm-update.yml) [GitHub action](https://github.com/features/actions).
diff --git a/cockpituous-release b/cockpituous-release
index f53ec27..7aebbf1 100644
--- a/cockpituous-release
+++ b/cockpituous-release
@@ -1,5 +1,5 @@
# This is a script run to release this project through Cockpituous:
-# https://github.com/cockpit-project/cockpituous/tree/master/release
+# https://github.com/cockpit-project/cockpituous/tree/main/release
# Anything that start with 'job' may run in a way that it SIGSTOP's
# itself when preliminary preparition and then gets a SIGCONT in
@@ -23,7 +23,7 @@ job release-srpm -V
## Authenticate for pushing into Fedora dist-git
# cat ~/.fedora-password | kinit yourfedorauser@FEDORAPROJECT.ORG
## Do fedora builds for the tag, using tarball
-# job release-koji -k master
+# job release-koji -k main
# job release-koji f33
# job release-bodhi F33
diff --git a/test/browser/browser.sh b/test/browser/browser.sh
index 7457dc9..4a48f9e 100755
--- a/test/browser/browser.sh
+++ b/test/browser/browser.sh
@@ -39,7 +39,7 @@ if ! id runtest 2>/dev/null; then
useradd -c 'Test runner' runtest
# allow test to set up things on the machine
mkdir -p /root/.ssh
- curl https://raw.githubusercontent.com/cockpit-project/bots/master/machine/identity.pub >> /root/.ssh/authorized_keys
+ curl https://raw.githubusercontent.com/cockpit-project/bots/main/machine/identity.pub >> /root/.ssh/authorized_keys
chmod 600 /root/.ssh/authorized_keys
fi
chown -R runtest "$SOURCE"
diff --git a/test/check-application b/test/check-application
index 4227c2d..b149d16 100755
--- a/test/check-application
+++ b/test/check-application
@@ -1,6 +1,6 @@
#!/usr/bin/python3
# Run this with --help to see available options for tracing and debugging
-# See https://github.com/cockpit-project/cockpit/blob/master/test/common/testlib.py
+# See https://github.com/cockpit-project/cockpit/blob/main/test/common/testlib.py
# "class Browser" and "class MachineCase" for the available API.
import os
From cfaa74f76175f9669eff3e0d9d050e5441aa5351 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Tue, 6 Jul 2021 09:02:39 +0200
Subject: [PATCH 240/942] test: Fix host name lookup (#473)
Our code reads /etc/hostname. Do the same in the test, as the runtime
sethostname(2) (set by hostnamed) and static host name may be different.
---
test/check-application | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/check-application b/test/check-application
index b149d16..2a13ce3 100755
--- a/test/check-application
+++ b/test/check-application
@@ -25,7 +25,7 @@ class TestApplication(testlib.MachineCase):
b.wait_text(".pf-c-card__title", "Starter Kit")
# verify expected host name
- hostname = m.execute("hostname").strip()
+ hostname = m.execute("cat /etc/hostname").strip()
b.wait_in_text(".pf-c-alert__title", "Running on " + hostname)
# change current hostname
From 4d9dd8c11ee65eb5371da77ca55f83b73bf41ee5 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Tue, 6 Jul 2021 07:55:40 +0200
Subject: [PATCH 241/942] workflows: Run release workflow in release
environment
This partitions secrets and limits their potential exposure/leakage.
This environment can be created with github-upload-action-secrets in [1].
[1] https://github.com/cockpit-project/bots/pull/2164
---
.github/workflows/release.yml.disabled | 1 +
1 file changed, 1 insertion(+)
diff --git a/.github/workflows/release.yml.disabled b/.github/workflows/release.yml.disabled
index 0f611bb..98e2409 100644
--- a/.github/workflows/release.yml.disabled
+++ b/.github/workflows/release.yml.disabled
@@ -7,6 +7,7 @@ on:
jobs:
cockpituous:
runs-on: ubuntu-latest
+ environment: release
container:
image: ghcr.io/cockpit-project/release
steps:
From 28466f72177a690798b7e62639573dc467624726 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Fri, 23 Jul 2021 07:24:35 +0200
Subject: [PATCH 242/942] webpack: Move from sassc to Dart sass
Fixes #475
---
.github/workflows/livetest.yml.disabled | 2 +-
package.json | 2 ++
webpack.config.js | 38 ++++++++++++++-----------
3 files changed, 24 insertions(+), 18 deletions(-)
diff --git a/.github/workflows/livetest.yml.disabled b/.github/workflows/livetest.yml.disabled
index 3130783..37d4ea4 100644
--- a/.github/workflows/livetest.yml.disabled
+++ b/.github/workflows/livetest.yml.disabled
@@ -44,7 +44,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt update
- sudo apt install -y cockpit-system cockpit-ws nodejs npm sassc make
+ sudo apt install -y cockpit-system cockpit-ws nodejs npm make
- uses: actions/github-script@v3
id: get-pr
diff --git a/package.json b/package.json
index 80c09e2..5480494 100644
--- a/package.json
+++ b/package.json
@@ -38,6 +38,8 @@
"mini-css-extract-plugin": "^0.11.0",
"po2json": "^1.0.0-alpha",
"qunit": "^2.9.3",
+ "sass": "^1.35.2",
+ "sass-loader": "^12.1.0",
"sizzle": "^2.3.3",
"stdio": "^2.1.0",
"string-replace-loader": "^3.0.0",
diff --git a/webpack.config.js b/webpack.config.js
index e2caf5f..8b5aa1d 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -1,5 +1,4 @@
const path = require("path");
-const childProcess = require('child_process');
const copy = require("copy-webpack-plugin");
const extract = require("mini-css-extract-plugin");
@@ -37,22 +36,11 @@ if (production) {
}));
}
-/* check if sassc is available, to avoid unintelligible error messages */
-try {
- childProcess.execFileSync('sassc', ['--version'], { stdio: ['pipe', 'inherit', 'inherit'] });
-} catch (e) {
- if (e.code === 'ENOENT') {
- console.error("ERROR: You need to install the 'sassc' package to build this project.");
- process.exit(1);
- } else {
- throw e;
- }
-}
-
module.exports = {
mode: production ? 'production' : 'development',
resolve: {
- modules: [ nodedir ],
+ modules: [ nodedir, path.resolve(__dirname, 'src/lib') ],
+ alias: { 'font-awesome': path.resolve(nodedir, 'font-awesome-sass/assets/stylesheets') },
},
resolveLoader: {
modules: [ nodedir, path.resolve(__dirname, 'src/lib') ],
@@ -90,7 +78,7 @@ module.exports = {
options: {
sourceMap: true,
url: false,
- }
+ },
},
{
loader: 'string-replace-loader',
@@ -107,7 +95,15 @@ module.exports = {
]
},
},
- 'sassc-loader',
+ {
+ loader: 'sass-loader',
+ options: {
+ sourceMap: !production,
+ sassOptions: {
+ outputStyle: production ? 'compressed' : undefined,
+ },
+ },
+ },
]
},
{
@@ -122,7 +118,15 @@ module.exports = {
url: false
}
},
- 'sassc-loader',
+ {
+ loader: 'sass-loader',
+ options: {
+ sourceMap: !production,
+ sassOptions: {
+ outputStyle: production ? 'compressed' : undefined,
+ },
+ },
+ },
]
},
]
From a509dde986e4d4ea02a5d9ce4c1bd1bd85e99047 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Fri, 23 Jul 2021 07:39:58 +0200
Subject: [PATCH 243/942] Update terser-webpack-plugin
Following our other projects.
---
cockpit-starter-kit.spec.in | 2 +-
package.json | 2 +-
packit.yaml | 2 +-
webpack.config.js | 13 ++++++++++++-
4 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/cockpit-starter-kit.spec.in b/cockpit-starter-kit.spec.in
index 32520fd..49c06fe 100644
--- a/cockpit-starter-kit.spec.in
+++ b/cockpit-starter-kit.spec.in
@@ -28,7 +28,7 @@ find %{buildroot}%{_datadir}/cockpit/ -name '*.map' | xargs --no-run-if-empty rm
%files
%doc README.md
-%license LICENSE dist/index.js.LICENSE.txt
+%license LICENSE dist/index.js.LICENSE.txt.gz
%{_datadir}/cockpit/*
%{_datadir}/metainfo/*
diff --git a/package.json b/package.json
index 5480494..a36448f 100644
--- a/package.json
+++ b/package.json
@@ -43,7 +43,7 @@
"sizzle": "^2.3.3",
"stdio": "^2.1.0",
"string-replace-loader": "^3.0.0",
- "terser-webpack-plugin": "^2.0.1",
+ "terser-webpack-plugin": "^5.1.4",
"webpack": "^5.31.0",
"webpack-cli": "^4.6.0"
},
diff --git a/packit.yaml b/packit.yaml
index 33ec1ab..1b0e37f 100644
--- a/packit.yaml
+++ b/packit.yaml
@@ -12,7 +12,7 @@ actions:
create-archive:
- make NODE_ENV=development NODE_OPTIONS=--max-old-space-size=500
# dummy LICENSE.txt, as terser did not run
- - touch dist/index.js.LICENSE.txt
+ - touch dist/index.js.LICENSE.txt.gz
- make dist-gzip
# starter-kit.git has no release tags; your project can drop this once you have a release
get-current-version: make print-version
diff --git a/webpack.config.js b/webpack.config.js
index 8b5aa1d..5f4737b 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -58,7 +58,18 @@ module.exports = {
optimization: {
minimize: production,
- minimizer: [new TerserJSPlugin(), new CssMinimizerPlugin()],
+ minimizer: [
+ new TerserJSPlugin({
+ extractComments: {
+ condition: true,
+ filename: `[file].LICENSE.txt?query=[query]&filebase=[base]`,
+ banner(licenseFile) {
+ return `License information can be found in ${licenseFile}`;
+ },
+ },
+ }),
+ new CssMinimizerPlugin()
+ ],
},
module: {
From 8b7b3f246b8d1b3efc465152c33d62ce83d03edf Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Fri, 23 Jul 2021 07:49:09 +0200
Subject: [PATCH 244/942] npm: Bump CSS loader
---
package.json | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/package.json b/package.json
index a36448f..691465d 100644
--- a/package.json
+++ b/package.json
@@ -20,8 +20,8 @@
"chrome-remote-interface": "^0.28.0",
"compression-webpack-plugin": "^6.0.0",
"copy-webpack-plugin": "^6.1.0",
- "css-loader": "^4.3.0",
- "css-minimizer-webpack-plugin": "^1.3.0",
+ "css-loader": "^5.2.0",
+ "css-minimizer-webpack-plugin": "^3.0.1",
"eslint": "^7.10.0",
"eslint-config-standard": "^14.1.1",
"eslint-config-standard-react": "^9.2.0",
From 0016765d016148f218e0b61c8b014fb31a7ff879 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Fri, 23 Jul 2021 08:18:34 +0200
Subject: [PATCH 245/942] Bump cockpit test API to 249
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index fc61ece..98ba84c 100644
--- a/Makefile
+++ b/Makefile
@@ -147,7 +147,7 @@ bots:
# when you start a new project, use the latest release, and update it from time to time
test/common:
flock Makefile sh -ec '\
- git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 242; \
+ git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 249; \
git checkout --force FETCH_HEAD -- test/common; \
git reset test/common'
From 3d227bcb36e67043d157d3a94f47fb29f8289b93 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Fri, 23 Jul 2021 08:23:42 +0200
Subject: [PATCH 246/942] Bump Cockpit pkg/lib to 249
Cockpit 247 changed cockpit-po-plugin.js to always expect a line number
in msgid references [1]. Also sync manifest2po from Cockpit 249 to
generate that reference for manifests, so that they keep getting
included into the translation js.
[1] https://github.com/cockpit-project/cockpit/commit/0ecc3a705d0cd6064
---
Makefile | 2 +-
po/de.po | 2 +-
po/manifest2po | 6 +++---
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/Makefile b/Makefile
index 98ba84c..baaee7c 100644
--- a/Makefile
+++ b/Makefile
@@ -154,7 +154,7 @@ test/common:
# checkout Cockpit's PF/React/build library; again this has no API stability guarantee, so check out a stable tag
$(LIB_TEST):
flock Makefile sh -ec '\
- git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 242; \
+ git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 249; \
git checkout --force FETCH_HEAD -- pkg/lib; \
git reset -- pkg/lib'
mv pkg/lib src/ && rmdir -p pkg
diff --git a/po/de.po b/po/de.po
index 91b4e60..8d86d06 100644
--- a/po/de.po
+++ b/po/de.po
@@ -22,7 +22,7 @@ msgstr "Cockpit Bausatz"
msgid "Running on $0"
msgstr "Läuft auf $0"
-#: src/manifest.json
+#: src/manifest.json:0
msgid "Starter Kit"
msgstr "Bausatz"
diff --git a/po/manifest2po b/po/manifest2po
index 9fc9ee5..46fa744 100755
--- a/po/manifest2po
+++ b/po/manifest2po
@@ -100,7 +100,7 @@ function process_keywords(keywords) {
v.matches.forEach(keyword =>
push({
msgid: keyword,
- locations: [ filename ]
+ locations: [ filename + ":0" ]
})
);
});
@@ -110,7 +110,7 @@ function process_docs(docs) {
docs.forEach(doc => {
push({
msgid: doc.label,
- locations: [ filename ]
+ locations: [ filename + ":0" ]
})
});
}
@@ -120,7 +120,7 @@ function process_menu(menu) {
if (menu[m].label) {
push({
msgid: menu[m].label,
- locations: [ filename ]
+ locations: [ filename + ":0" ]
});
}
if (menu[m].keywords)
From e44d170dab038becf5f0d68464e16d1ed201d2f7 Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Sat, 31 Jul 2021 02:32:02 +0000
Subject: [PATCH 247/942] package.json: Update core-js
Closes #478
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 691465d..5073c5e 100644
--- a/package.json
+++ b/package.json
@@ -50,7 +50,7 @@
"dependencies": {
"@patternfly/patternfly": "4.115.2",
"@patternfly/react-core": "4.135.0",
- "core-js": "3.15.2",
+ "core-js": "3.16.0",
"react": "16.14.0",
"react-dom": "16.14.0"
}
From 61c708974a0e0ec135f424e420de803c201007b8 Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Fri, 6 Aug 2021 02:30:52 +0000
Subject: [PATCH 248/942] package.json: Update @patternfly/react-core,
@patternfly/patternfly
Closes #479
---
package.json | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/package.json b/package.json
index 5073c5e..db864f4 100644
--- a/package.json
+++ b/package.json
@@ -48,8 +48,8 @@
"webpack-cli": "^4.6.0"
},
"dependencies": {
- "@patternfly/patternfly": "4.115.2",
- "@patternfly/react-core": "4.135.0",
+ "@patternfly/patternfly": "4.125.3",
+ "@patternfly/react-core": "4.147.0",
"core-js": "3.16.0",
"react": "16.14.0",
"react-dom": "16.14.0"
From 40f3121e90770dd6fb6a05661b845f77038cb361 Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Mon, 9 Aug 2021 02:29:30 +0000
Subject: [PATCH 249/942] package.json: Update core-js
Closes #480
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index db864f4..0fba7a1 100644
--- a/package.json
+++ b/package.json
@@ -50,7 +50,7 @@
"dependencies": {
"@patternfly/patternfly": "4.125.3",
"@patternfly/react-core": "4.147.0",
- "core-js": "3.16.0",
+ "core-js": "3.16.1",
"react": "16.14.0",
"react-dom": "16.14.0"
}
From 91043e26c59def09b22dcb2acceed22baf71a509 Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Wed, 18 Aug 2021 02:29:12 +0000
Subject: [PATCH 250/942] package.json: Update core-js
Closes #481
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 0fba7a1..e310396 100644
--- a/package.json
+++ b/package.json
@@ -50,7 +50,7 @@
"dependencies": {
"@patternfly/patternfly": "4.125.3",
"@patternfly/react-core": "4.147.0",
- "core-js": "3.16.1",
+ "core-js": "3.16.2",
"react": "16.14.0",
"react-dom": "16.14.0"
}
From 92d7e38d49b14a6845c6941f31215de8a9458e1b Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Wed, 25 Aug 2021 02:30:06 +0000
Subject: [PATCH 251/942] package.json: Update core-js
Closes #482
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index e310396..2a980db 100644
--- a/package.json
+++ b/package.json
@@ -50,7 +50,7 @@
"dependencies": {
"@patternfly/patternfly": "4.125.3",
"@patternfly/react-core": "4.147.0",
- "core-js": "3.16.2",
+ "core-js": "3.16.3",
"react": "16.14.0",
"react-dom": "16.14.0"
}
From a84bd78b618204f44bcd2c86a729c6e29ac06071 Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Fri, 27 Aug 2021 02:31:32 +0000
Subject: [PATCH 252/942] package.json: Update @patternfly/react-core,
@patternfly/patternfly
Closes #483
---
package.json | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/package.json b/package.json
index 2a980db..dcebf44 100644
--- a/package.json
+++ b/package.json
@@ -48,8 +48,8 @@
"webpack-cli": "^4.6.0"
},
"dependencies": {
- "@patternfly/patternfly": "4.125.3",
- "@patternfly/react-core": "4.147.0",
+ "@patternfly/patternfly": "4.132.2",
+ "@patternfly/react-core": "4.152.4",
"core-js": "3.16.3",
"react": "16.14.0",
"react-dom": "16.14.0"
From 78ea4a529ac34606899da9d409ef59b77e062704 Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Mon, 30 Aug 2021 02:29:41 +0000
Subject: [PATCH 253/942] package.json: Update core-js
Closes #484
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index dcebf44..9bd8836 100644
--- a/package.json
+++ b/package.json
@@ -50,7 +50,7 @@
"dependencies": {
"@patternfly/patternfly": "4.132.2",
"@patternfly/react-core": "4.152.4",
- "core-js": "3.16.3",
+ "core-js": "3.16.4",
"react": "16.14.0",
"react-dom": "16.14.0"
}
From fb4c4346c99f554ba118bb91bc872ae76e12e40d Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Thu, 2 Sep 2021 02:29:35 +0000
Subject: [PATCH 254/942] package.json: Update core-js
Closes #485
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 9bd8836..bfd1089 100644
--- a/package.json
+++ b/package.json
@@ -50,7 +50,7 @@
"dependencies": {
"@patternfly/patternfly": "4.132.2",
"@patternfly/react-core": "4.152.4",
- "core-js": "3.16.4",
+ "core-js": "3.17.1",
"react": "16.14.0",
"react-dom": "16.14.0"
}
From c1f8802da6bef51b1924ce070afa8a021db12ba3 Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Fri, 3 Sep 2021 02:30:47 +0000
Subject: [PATCH 255/942] package.json: Update core-js
Closes #486
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index bfd1089..ebcfbd4 100644
--- a/package.json
+++ b/package.json
@@ -50,7 +50,7 @@
"dependencies": {
"@patternfly/patternfly": "4.132.2",
"@patternfly/react-core": "4.152.4",
- "core-js": "3.17.1",
+ "core-js": "3.17.2",
"react": "16.14.0",
"react-dom": "16.14.0"
}
From a44ef8bb61d560620d7f4f624dfcdec5ae483709 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Fri, 3 Sep 2021 07:16:33 +0200
Subject: [PATCH 256/942] cirrus CI: Move to Fedora 35
---
.cirrus.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.cirrus.yml b/.cirrus.yml
index 92aabeb..118fb21 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -10,7 +10,7 @@ container:
test_task:
env:
matrix:
- - TEST_OS: fedora-33
+ - TEST_OS: fedora-35
- TEST_OS: centos-8-stream
fix_kvm_script: sudo chmod 666 /dev/kvm
From 0134d26783cf215c180091cb2a60876fa393a645 Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Fri, 10 Sep 2021 02:31:52 +0000
Subject: [PATCH 257/942] package.json: Update core-js
Closes #489
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index ebcfbd4..9f60e60 100644
--- a/package.json
+++ b/package.json
@@ -50,7 +50,7 @@
"dependencies": {
"@patternfly/patternfly": "4.132.2",
"@patternfly/react-core": "4.152.4",
- "core-js": "3.17.2",
+ "core-js": "3.17.3",
"react": "16.14.0",
"react-dom": "16.14.0"
}
From 03d8324c193028a6f9f96b929e71eaf85eb85ae8 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Fri, 3 Sep 2021 07:50:39 +0200
Subject: [PATCH 258/942] Makefile: Avoid moving node_modules/ during dist
build
This is ugly as it races with other make targets which expect
node_modules/ to exist. It's also unnecessary, we can just tell tar to
ignore node_modules/.
---
Makefile | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index baaee7c..6bd204a 100644
--- a/Makefile
+++ b/Makefile
@@ -88,13 +88,11 @@ dist-gzip: $(TARFILE)
$(TARFILE): export NODE_ENV=production
$(TARFILE): $(WEBPACK_TEST) cockpit-$(PACKAGE_NAME).spec
if type appstream-util >/dev/null 2>&1; then appstream-util validate-relax --nonet *.metainfo.xml; fi
- mv node_modules node_modules.release
touch -r package.json $(NODE_MODULES_TEST)
touch dist/*
tar czf cockpit-$(PACKAGE_NAME)-$(VERSION).tar.gz --transform 's,^,cockpit-$(PACKAGE_NAME)/,' \
- --exclude cockpit-$(PACKAGE_NAME).spec.in \
+ --exclude cockpit-$(PACKAGE_NAME).spec.in --exclude node_modules \
$$(git ls-files) $(LIB_TEST) src/lib/patternfly/*.scss package-lock.json cockpit-$(PACKAGE_NAME).spec dist/
- mv node_modules.release node_modules
srpm: $(TARFILE) cockpit-$(PACKAGE_NAME).spec
rpmbuild -bs \
From e49b2747bcc91a9e4e64fce699c664ead5728c14 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Wed, 8 Sep 2021 14:20:43 +0200
Subject: [PATCH 259/942] Makefile: Avoid `npm` dependency for building webpack
Avoid the indirection, and directly call webpack. This avoids adding an
`npm` build dependency if/when the RPM wants to rebuild the webpack
during package build.
---
Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 6bd204a..b3ece23 100644
--- a/Makefile
+++ b/Makefile
@@ -55,10 +55,10 @@ update-po: po/$(PACKAGE_NAME).pot
sed -e 's/%{VERSION}/$(VERSION)/g' $< > $@
$(WEBPACK_TEST): $(NODE_MODULES_TEST) $(LIB_TEST) $(shell find src/ -type f) package.json webpack.config.js
- NODE_ENV=$(NODE_ENV) npm run build
+ NODE_ENV=$(NODE_ENV) node_modules/.bin/webpack
watch:
- NODE_ENV=$(NODE_ENV) npm run watch
+ NODE_ENV=$(NODE_ENV) node_modules/.bin/webpack --watch
clean:
rm -rf dist/
From 94194c51870348f7ec9f5ff86b9330d90ade3e42 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Fri, 3 Sep 2021 09:32:31 +0200
Subject: [PATCH 260/942] Makefile: Ship full src/lib/ in release tarballs
Otherwise it is incomplete and can't be rebuilt.
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index b3ece23..68b904a 100644
--- a/Makefile
+++ b/Makefile
@@ -92,7 +92,7 @@ $(TARFILE): $(WEBPACK_TEST) cockpit-$(PACKAGE_NAME).spec
touch dist/*
tar czf cockpit-$(PACKAGE_NAME)-$(VERSION).tar.gz --transform 's,^,cockpit-$(PACKAGE_NAME)/,' \
--exclude cockpit-$(PACKAGE_NAME).spec.in --exclude node_modules \
- $$(git ls-files) $(LIB_TEST) src/lib/patternfly/*.scss package-lock.json cockpit-$(PACKAGE_NAME).spec dist/
+ $$(git ls-files) $(LIB_TEST) src/lib package-lock.json cockpit-$(PACKAGE_NAME).spec dist/
srpm: $(TARFILE) cockpit-$(PACKAGE_NAME).spec
rpmbuild -bs \
From 26be6c8540244c42bb5c48d2bd5563c645bb0fee Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Thu, 2 Sep 2021 15:59:29 +0200
Subject: [PATCH 261/942] Add a `make node-cache`
The node_modules cache tarball will be published as release artifact, to
make sure that any release can be rebuilt in a reproducible way.
Cockpituous' release-source will call this if available:
https://github.com/cockpit-project/cockpituous/pull/438
---
Makefile | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 68b904a..48a8c69 100644
--- a/Makefile
+++ b/Makefile
@@ -6,6 +6,7 @@ TEST_OS = centos-8-stream
endif
export TEST_OS
TARFILE=cockpit-$(PACKAGE_NAME)-$(VERSION).tar.gz
+NODE_CACHE=cockpit-$(PACKAGE_NAME)-node-$(VERSION).tar.xz
RPMFILE=$(shell rpmspec -D"VERSION $(VERSION)" -q cockpit-$(PACKAGE_NAME).spec.in).rpm
VM_IMAGE=$(CURDIR)/test/images/$(TEST_OS)
# stamp file to check if/when npm install ran
@@ -94,6 +95,11 @@ $(TARFILE): $(WEBPACK_TEST) cockpit-$(PACKAGE_NAME).spec
--exclude cockpit-$(PACKAGE_NAME).spec.in --exclude node_modules \
$$(git ls-files) $(LIB_TEST) src/lib package-lock.json cockpit-$(PACKAGE_NAME).spec dist/
+$(NODE_CACHE): $(NODE_MODULES_TEST)
+ tar --xz -cf $@ node_modules
+
+node-cache: $(NODE_CACHE)
+
srpm: $(TARFILE) cockpit-$(PACKAGE_NAME).spec
rpmbuild -bs \
--define "_sourcedir `pwd`" \
@@ -164,4 +170,4 @@ $(NODE_MODULES_TEST): package.json
env -u NODE_ENV npm install
env -u NODE_ENV npm prune
-.PHONY: all clean install devel-install print-version dist-gzip srpm rpm check vm update-po
+.PHONY: all clean install devel-install print-version dist-gzip node-cache srpm rpm check vm update-po
From 4ca75f143c40794ee22799da4780cc2154c757c6 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Thu, 9 Sep 2021 14:17:55 +0200
Subject: [PATCH 262/942] Move to xz dist tarballs
For consistency with the already xz'ed node tarball.
Rename the oddly named `dist-gzip` target to the standard `dist`.
---
.gitignore | 2 +-
Makefile | 8 ++++----
README.md | 2 +-
cockpit-starter-kit.spec.in | 2 +-
packit.yaml | 2 +-
5 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/.gitignore b/.gitignore
index 59b5f3d..3eaef89 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,6 @@
*~
*.retry
-*.tar.gz
+*.tar.xz
*.rpm
node_modules/
dist/
diff --git a/Makefile b/Makefile
index 48a8c69..e8aa2a5 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@ ifeq ($(TEST_OS),)
TEST_OS = centos-8-stream
endif
export TEST_OS
-TARFILE=cockpit-$(PACKAGE_NAME)-$(VERSION).tar.gz
+TARFILE=cockpit-$(PACKAGE_NAME)-$(VERSION).tar.xz
NODE_CACHE=cockpit-$(PACKAGE_NAME)-node-$(VERSION).tar.xz
RPMFILE=$(shell rpmspec -D"VERSION $(VERSION)" -q cockpit-$(PACKAGE_NAME).spec.in).rpm
VM_IMAGE=$(CURDIR)/test/images/$(TEST_OS)
@@ -79,7 +79,7 @@ devel-install: $(WEBPACK_TEST)
print-version:
@echo "$(VERSION)"
-dist-gzip: $(TARFILE)
+dist: $(TARFILE)
@ls -1 $(TARFILE)
# when building a distribution tarball, call webpack with a 'production' environment
@@ -91,7 +91,7 @@ $(TARFILE): $(WEBPACK_TEST) cockpit-$(PACKAGE_NAME).spec
if type appstream-util >/dev/null 2>&1; then appstream-util validate-relax --nonet *.metainfo.xml; fi
touch -r package.json $(NODE_MODULES_TEST)
touch dist/*
- tar czf cockpit-$(PACKAGE_NAME)-$(VERSION).tar.gz --transform 's,^,cockpit-$(PACKAGE_NAME)/,' \
+ tar --xz -cf cockpit-$(PACKAGE_NAME)-$(VERSION).tar.xz --transform 's,^,cockpit-$(PACKAGE_NAME)/,' \
--exclude cockpit-$(PACKAGE_NAME).spec.in --exclude node_modules \
$$(git ls-files) $(LIB_TEST) src/lib package-lock.json cockpit-$(PACKAGE_NAME).spec dist/
@@ -170,4 +170,4 @@ $(NODE_MODULES_TEST): package.json
env -u NODE_ENV npm install
env -u NODE_ENV npm prune
-.PHONY: all clean install devel-install print-version dist-gzip node-cache srpm rpm check vm update-po
+.PHONY: all clean install devel-install print-version dist node-cache srpm rpm check vm update-po
diff --git a/README.md b/README.md
index 7b9e3c2..73d76b3 100644
--- a/README.md
+++ b/README.md
@@ -17,7 +17,7 @@ make
`make install` compiles and installs the package in `/usr/share/cockpit/`. The
convenience targets `srpm` and `rpm` build the source and binary rpms,
-respectively. Both of these make use of the `dist-gzip` target, which is used
+respectively. Both of these make use of the `dist` target, which is used
to generate the distribution tarball. In `production` mode, source files are
automatically minified and compressed. Set `NODE_ENV=production` if you want to
duplicate this behavior.
diff --git a/cockpit-starter-kit.spec.in b/cockpit-starter-kit.spec.in
index 49c06fe..76379ff 100644
--- a/cockpit-starter-kit.spec.in
+++ b/cockpit-starter-kit.spec.in
@@ -4,7 +4,7 @@ Release: 1%{?dist}
Summary: Cockpit Starter Kit Example Module
License: LGPLv2+
-Source: cockpit-starter-kit-%{version}.tar.gz
+Source: cockpit-starter-kit-%{version}.tar.xz
BuildArch: noarch
BuildRequires: make
BuildRequires: libappstream-glib
diff --git a/packit.yaml b/packit.yaml
index 1b0e37f..ad67ffe 100644
--- a/packit.yaml
+++ b/packit.yaml
@@ -13,7 +13,7 @@ actions:
- make NODE_ENV=development NODE_OPTIONS=--max-old-space-size=500
# dummy LICENSE.txt, as terser did not run
- touch dist/index.js.LICENSE.txt.gz
- - make dist-gzip
+ - make dist
# starter-kit.git has no release tags; your project can drop this once you have a release
get-current-version: make print-version
jobs:
From 9574611768d66728983835a77437851cfcc67ca9 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Fri, 3 Sep 2021 09:39:04 +0200
Subject: [PATCH 263/942] Rebuild webpack during RPM build
This is necessary to comply with Fedora's packaging policy:
https://docs.fedoraproject.org/en-US/packaging-guidelines/JavaScript/
Include the node cache in the source rpm, unpack it into the main source
dir, and force a webpack rebuild in `%build`.
---
Makefile | 4 ++--
cockpit-starter-kit.spec.in | 12 ++++++++++--
packit.yaml | 7 ++++++-
3 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/Makefile b/Makefile
index e8aa2a5..d9adb8d 100644
--- a/Makefile
+++ b/Makefile
@@ -100,7 +100,7 @@ $(NODE_CACHE): $(NODE_MODULES_TEST)
node-cache: $(NODE_CACHE)
-srpm: $(TARFILE) cockpit-$(PACKAGE_NAME).spec
+srpm: $(TARFILE) $(NODE_CACHE) cockpit-$(PACKAGE_NAME).spec
rpmbuild -bs \
--define "_sourcedir `pwd`" \
--define "_srcrpmdir `pwd`" \
@@ -108,7 +108,7 @@ srpm: $(TARFILE) cockpit-$(PACKAGE_NAME).spec
rpm: $(RPMFILE)
-$(RPMFILE): $(TARFILE) cockpit-$(PACKAGE_NAME).spec
+$(RPMFILE): $(TARFILE) $(NODE_CACHE) cockpit-$(PACKAGE_NAME).spec
mkdir -p "`pwd`/output"
mkdir -p "`pwd`/rpmbuild"
rpmbuild -bb \
diff --git a/cockpit-starter-kit.spec.in b/cockpit-starter-kit.spec.in
index 76379ff..60d6b18 100644
--- a/cockpit-starter-kit.spec.in
+++ b/cockpit-starter-kit.spec.in
@@ -4,8 +4,10 @@ Release: 1%{?dist}
Summary: Cockpit Starter Kit Example Module
License: LGPLv2+
-Source: cockpit-starter-kit-%{version}.tar.xz
+Source0: https://github.com/cockpit-project/starter-kit/releases/download/%{version}/cockpit-starter-kit-%{version}.tar.xz
+Source1: https://github.com/cockpit-project/starter-kit/releases/download/%{version}/cockpit-starter-kit-node-%{version}.tar.xz
BuildArch: noarch
+BuildRequires: nodejs
BuildRequires: make
BuildRequires: libappstream-glib
@@ -17,7 +19,13 @@ Requires: cockpit-system
Cockpit Starter Kit Example Module
%prep
-%setup -n cockpit-starter-kit
+%setup -q -n cockpit-starter-kit
+%setup -q -a 1 -n cockpit-starter-kit
+
+%build
+# ignore pre-built webpack in release tarball and rebuild it
+rm -rf dist
+NODE_ENV=production make
%install
%make_install
diff --git a/packit.yaml b/packit.yaml
index ad67ffe..eab91f3 100644
--- a/packit.yaml
+++ b/packit.yaml
@@ -4,7 +4,12 @@
specfile_path: cockpit-starter-kit.spec
actions:
- post-upstream-clone: make cockpit-starter-kit.spec
+ post-upstream-clone:
+ post-upstream-clone:
+ - make cockpit-starter-kit.spec
+ # replace Source1 manually, as create-archive: can't handle multiple tarballs
+ - make node-cache
+ - sh -c 'sed -i "/^Source1:/ s/https:.*/$(ls *-node*.tar.xz)/" cockpit-*.spec'
# build in development mode; production mode uses too much memory for limited
# sandcastle containers; also reduce memory consumption of webpack
# https://github.com/packit/sandcastle/pull/92
From 6ff3b7d6bcf2ba78b5d2c70ff3f6a5076e5837e5 Mon Sep 17 00:00:00 2001
From: Jelle van der Waa
Date: Mon, 13 Sep 2021 18:38:32 +0200
Subject: [PATCH 264/942] .gitignore: add tmp directory
Include to tmp/ directory to be ignored, it usually contains temporary
vm-run images.
---
.gitignore | 1 +
1 file changed, 1 insertion(+)
diff --git a/.gitignore b/.gitignore
index 3eaef89..7e82360 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,3 +14,4 @@ test/images/
src/lib/
*.pot
POTFILES*
+tmp/
From 64b83498aaafcaf2b40fb857cf75919c6158cdb4 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Thu, 16 Sep 2021 08:53:20 +0200
Subject: [PATCH 265/942] Makefile: Avoid cockpit-po-plugin.js hardlink in dist
tarball
Drop the redundant `$(LIB_TEST)` from the tar file list; it is
src/lib/cockpit-po-plugin.js, which is already contained in src/lib, and
tar turns that into an unsightly hardlink.
See https://github.com/cockpit-project/cockpit-machines/issues/379
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index d9adb8d..818cdd9 100644
--- a/Makefile
+++ b/Makefile
@@ -93,7 +93,7 @@ $(TARFILE): $(WEBPACK_TEST) cockpit-$(PACKAGE_NAME).spec
touch dist/*
tar --xz -cf cockpit-$(PACKAGE_NAME)-$(VERSION).tar.xz --transform 's,^,cockpit-$(PACKAGE_NAME)/,' \
--exclude cockpit-$(PACKAGE_NAME).spec.in --exclude node_modules \
- $$(git ls-files) $(LIB_TEST) src/lib package-lock.json cockpit-$(PACKAGE_NAME).spec dist/
+ $$(git ls-files) src/lib package-lock.json cockpit-$(PACKAGE_NAME).spec dist/
$(NODE_CACHE): $(NODE_MODULES_TEST)
tar --xz -cf $@ node_modules
From cd0b88682d17115cfeb65921d92a54a497d19536 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Thu, 16 Sep 2021 09:05:13 +0200
Subject: [PATCH 266/942] Bump cockpit lib and test framework to 253
No changes necessary.
---
Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 818cdd9..b869d58 100644
--- a/Makefile
+++ b/Makefile
@@ -151,14 +151,14 @@ bots:
# when you start a new project, use the latest release, and update it from time to time
test/common:
flock Makefile sh -ec '\
- git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 249; \
+ git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 253; \
git checkout --force FETCH_HEAD -- test/common; \
git reset test/common'
# checkout Cockpit's PF/React/build library; again this has no API stability guarantee, so check out a stable tag
$(LIB_TEST):
flock Makefile sh -ec '\
- git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 249; \
+ git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 253; \
git checkout --force FETCH_HEAD -- pkg/lib; \
git reset -- pkg/lib'
mv pkg/lib src/ && rmdir -p pkg
From a5f319b804e3e066e27295fe7e812ee2d4fdcbe1 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Thu, 16 Sep 2021 09:12:35 +0200
Subject: [PATCH 267/942] spec: Avoid repeating package name
Use rpm's `%{name}` macro instead. This makes it easier for forks to
keep the spec file in sync.
---
cockpit-starter-kit.spec.in | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/cockpit-starter-kit.spec.in b/cockpit-starter-kit.spec.in
index 60d6b18..ae9f021 100644
--- a/cockpit-starter-kit.spec.in
+++ b/cockpit-starter-kit.spec.in
@@ -4,8 +4,8 @@ Release: 1%{?dist}
Summary: Cockpit Starter Kit Example Module
License: LGPLv2+
-Source0: https://github.com/cockpit-project/starter-kit/releases/download/%{version}/cockpit-starter-kit-%{version}.tar.xz
-Source1: https://github.com/cockpit-project/starter-kit/releases/download/%{version}/cockpit-starter-kit-node-%{version}.tar.xz
+Source0: https://github.com/cockpit-project/starter-kit/releases/download/%{version}/%{name}-%{version}.tar.xz
+Source1: https://github.com/cockpit-project/starter-kit/releases/download/%{version}/%{name}-node-%{version}.tar.xz
BuildArch: noarch
BuildRequires: nodejs
BuildRequires: make
@@ -19,8 +19,8 @@ Requires: cockpit-system
Cockpit Starter Kit Example Module
%prep
-%setup -q -n cockpit-starter-kit
-%setup -q -a 1 -n cockpit-starter-kit
+%setup -q -n %{name}
+%setup -q -a 1 -n %{name}
%build
# ignore pre-built webpack in release tarball and rebuild it
From aa1b3cb713dec3ebbda7c9600540621bf54b0369 Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Mon, 20 Sep 2021 02:32:09 +0000
Subject: [PATCH 268/942] package.json: Update core-js
Closes #494
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 9f60e60..0f53b5f 100644
--- a/package.json
+++ b/package.json
@@ -50,7 +50,7 @@
"dependencies": {
"@patternfly/patternfly": "4.132.2",
"@patternfly/react-core": "4.152.4",
- "core-js": "3.17.3",
+ "core-js": "3.18.0",
"react": "16.14.0",
"react-dom": "16.14.0"
}
From a8e052a78d3c1dde929c0dc2a6ac99f24e8acf51 Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Tue, 21 Sep 2021 02:31:34 +0000
Subject: [PATCH 269/942] package.json: Update @patternfly/react-core,
@patternfly/patternfly
Closes #495
---
package.json | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/package.json b/package.json
index 0f53b5f..6952be7 100644
--- a/package.json
+++ b/package.json
@@ -48,8 +48,8 @@
"webpack-cli": "^4.6.0"
},
"dependencies": {
- "@patternfly/patternfly": "4.132.2",
- "@patternfly/react-core": "4.152.4",
+ "@patternfly/patternfly": "4.135.2",
+ "@patternfly/react-core": "4.157.3",
"core-js": "3.18.0",
"react": "16.14.0",
"react-dom": "16.14.0"
From 3220617fec508aabbbc226a87a165c21fb72e913 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Tue, 21 Sep 2021 08:33:25 +0200
Subject: [PATCH 270/942] webpack: Avoid md4 hash for OpenSSL 3 compatibility
CentOS/RHEL 9 switched to OpenSSL 3, which does not support the `md4`
hash any more. webpack 5 hardcodes that in no less than 21 places, so
monkey-patch `crypto.createHash()` to substitute sha256 for md4.
Hack to work around https://github.com/webpack/webpack/issues/13572
---
webpack.config.js | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/webpack.config.js b/webpack.config.js
index 5f4737b..0cc78d3 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -8,6 +8,11 @@ const CompressionPlugin = require("compression-webpack-plugin");
const ESLintPlugin = require('eslint-webpack-plugin');
const CockpitPoPlugin = require("./src/lib/cockpit-po-plugin");
+// HACK: OpenSSL 3 does not support md4 any more, but webpack hardcodes it all over the place: https://github.com/webpack/webpack/issues/13572
+const crypto = require("crypto");
+const crypto_orig_createHash = crypto.createHash;
+crypto.createHash = algorithm => crypto_orig_createHash(algorithm == "md4" ? "sha256" : algorithm);
+
const webpack = require("webpack");
const nodedir = path.resolve((process.env.SRCDIR || __dirname), "node_modules");
From 7dc9fda24155c1cfccc1b218d09abe71d4483848 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Tue, 21 Sep 2021 09:56:52 +0200
Subject: [PATCH 271/942] eslint: Enable no-var rule
`var` has broken/unexpected scoping in JavaScript, and can lead to
subtle errors. It's preferable and safer to use `const` whenever
possible, and `let` where necessary.
There are no usages of `var` in starter-kit right now, so just enable
the rule to ensure that it stays that way.
---
.eslintrc.json | 1 +
1 file changed, 1 insertion(+)
diff --git a/.eslintrc.json b/.eslintrc.json
index 4572422..eaa27d8 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -23,6 +23,7 @@
"ignoredNodes": [ "JSXAttribute" ]
}],
"newline-per-chained-call": ["error", { "ignoreChainWithDepth": 2 }],
+ "no-var": "error",
"lines-between-class-members": ["error", "always", { "exceptAfterSingleLine": true }],
"prefer-promise-reject-errors": ["error", { "allowEmptyReject": true }],
"react/jsx-indent": ["error", 4],
From 6e2d0dd01c3bb25e6e6287004e51fc36eef787ca Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Mon, 27 Sep 2021 02:32:11 +0000
Subject: [PATCH 272/942] package.json: Update core-js
Closes #498
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 6952be7..fb5aae9 100644
--- a/package.json
+++ b/package.json
@@ -50,7 +50,7 @@
"dependencies": {
"@patternfly/patternfly": "4.135.2",
"@patternfly/react-core": "4.157.3",
- "core-js": "3.18.0",
+ "core-js": "3.18.1",
"react": "16.14.0",
"react-dom": "16.14.0"
}
From 11da2d284b4ef5dc84fd8d9ffcf1daea5c60430b Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Wed, 6 Oct 2021 02:32:07 +0000
Subject: [PATCH 273/942] package.json: Update core-js
Closes #499
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index fb5aae9..4e11d66 100644
--- a/package.json
+++ b/package.json
@@ -50,7 +50,7 @@
"dependencies": {
"@patternfly/patternfly": "4.135.2",
"@patternfly/react-core": "4.157.3",
- "core-js": "3.18.1",
+ "core-js": "3.18.2",
"react": "16.14.0",
"react-dom": "16.14.0"
}
From 0bc01714ee7d2e40ec305eeac18919c5a6241d04 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Thu, 7 Oct 2021 09:15:46 +0200
Subject: [PATCH 274/942] fmf: Run tests with firefox
Chromium has started to crash in current Fedora, and is not easily
available in RHEL.
Install bzip2 to unpack the nightly tarball.
---
test/browser/browser.sh | 17 +++++++----------
test/browser/main.fmf | 1 +
2 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/test/browser/browser.sh b/test/browser/browser.sh
index 4a48f9e..ca90003 100755
--- a/test/browser/browser.sh
+++ b/test/browser/browser.sh
@@ -12,15 +12,12 @@ LOGS="$(pwd)/logs"
mkdir -p "$LOGS"
chmod a+w "$LOGS"
-# install browser; on RHEL, use chromium from epel
-# HACK: chromium-headless ought to be enough, but version 88 has a crash: https://bugs.chromium.org/p/chromium/issues/detail?id=1170634
-if ! rpm -q chromium; then
- if grep -q 'ID=.*rhel' /etc/os-release; then
- dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
- dnf config-manager --enable epel
- fi
- dnf install -y chromium
-fi
+# install firefox (available everywhere in Fedora and RHEL); install the package to pull in all the dependencies
+# we don't need the H.264 codec, and it is sometimes not available (rhbz#2005760)
+dnf install --disablerepo=fedora-cisco-openh264 -y firefox
+# install nightly for Chrome DevTools Protocol support
+curl --location 'https://download.mozilla.org/?product=firefox-nightly-latest-ssl&os=linux64&lang=en-US' | tar -C /usr/local/lib/ -xj
+ln -s /usr/local/lib/firefox/firefox /usr/local/bin/
# create user account for logging in
if ! id admin 2>/dev/null; then
@@ -50,7 +47,7 @@ echo core > /proc/sys/kernel/core_pattern
systemctl enable --now cockpit.socket
# Run tests as unprivileged user
-su - -c "env SOURCE=$SOURCE LOGS=$LOGS $TESTS/run-test.sh" runtest
+su - -c "env TEST_BROWSER=firefox SOURCE=$SOURCE LOGS=$LOGS $TESTS/run-test.sh" runtest
RC=$(cat $LOGS/exitcode)
exit ${RC:-1}
diff --git a/test/browser/main.fmf b/test/browser/main.fmf
index a08584c..8302e30 100644
--- a/test/browser/main.fmf
+++ b/test/browser/main.fmf
@@ -4,6 +4,7 @@ require:
- cockpit-starter-kit
- cockpit-ws
- cockpit-system
+ - bzip2
- git
- glibc-langpack-de
- libvirt-python3
From 5d15bdac5c7c2ee72f768f0a5fd6ac8715711c13 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Thu, 7 Oct 2021 09:22:41 +0200
Subject: [PATCH 275/942] fmf: Dependency installation robustification
Sync some improvements from cockpit-machines:
* Unbreak running `tmt` in local trees with an already existing ./bots
symlink.
* Don't install all NPM packages, only chrome-remote-interface and sizzle.
* Disable detection of affected tests, taking too long for real
projects.
---
test/browser/run-test.sh | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/test/browser/run-test.sh b/test/browser/run-test.sh
index a3c7585..97bdcbd 100755
--- a/test/browser/run-test.sh
+++ b/test/browser/run-test.sh
@@ -4,11 +4,21 @@ set -eux
# tests need cockpit's bots/ libraries and test infrastructure
cd $SOURCE
git init
+rm -f bots # common local case: existing bots symlink
make bots test/common
-# only install a subset to save time/space
-rm -f package-lock.json # otherwise the command below installs *everything*, argh
-npm install chrome-remote-interface sizzle
+# support running from clean git tree
+if [ ! -d node_modules/chrome-remote-interface ]; then
+ # copy package.json temporarily otherwise npm might try to install the dependencies from it
+ rm -f package-lock.json # otherwise the command below installs *everything*, argh
+ mv package.json .package.json
+ # only install a subset to save time/space
+ npm install chrome-remote-interface sizzle
+ mv .package.json package.json
+fi
+
+# disable detection of affected tests; testing takes too long as there is no parallelization
+mv .git dot-git
. /etc/os-release
export TEST_OS="${ID}-${VERSION_ID/./-}"
From 72c15c4b82436a4623ead4ab91ba245716c91be9 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Thu, 7 Oct 2021 09:25:01 +0200
Subject: [PATCH 276/942] packit: Enable CentOS Stream 8
---
packit.yaml | 1 +
test/browser/run-test.sh | 4 ++++
2 files changed, 5 insertions(+)
diff --git a/packit.yaml b/packit.yaml
index eab91f3..4a8f605 100644
--- a/packit.yaml
+++ b/packit.yaml
@@ -27,3 +27,4 @@ jobs:
metadata:
targets:
- fedora-all
+ - centos-stream-8
diff --git a/test/browser/run-test.sh b/test/browser/run-test.sh
index 97bdcbd..0aee3c6 100755
--- a/test/browser/run-test.sh
+++ b/test/browser/run-test.sh
@@ -24,6 +24,10 @@ mv .git dot-git
export TEST_OS="${ID}-${VERSION_ID/./-}"
export TEST_AUDIT_NO_SELINUX=1
+if [ "$TEST_OS" = "centos-8" ]; then
+ TEST_OS=centos-8-stream
+fi
+
EXCLUDES=""
RC=0
From 8074af0fbdf2484bd4e2bf47015bae721834e63e Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Thu, 7 Oct 2021 09:50:36 +0200
Subject: [PATCH 277/942] fmf: Only install git-core
We don't need all the bells and whistles of the full git package.
---
test/browser/main.fmf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/browser/main.fmf b/test/browser/main.fmf
index 8302e30..d2dddd6 100644
--- a/test/browser/main.fmf
+++ b/test/browser/main.fmf
@@ -5,7 +5,7 @@ require:
- cockpit-ws
- cockpit-system
- bzip2
- - git
+ - git-core
- glibc-langpack-de
- libvirt-python3
- make
From 0abeda35284b84e49780aeca6e0df3fcfaafb737 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Tue, 12 Oct 2021 06:26:17 +0200
Subject: [PATCH 278/942] webpack: Use default resolve path for npm 7
compatibility
npm 7 changed how it resolves dependencies, and starter-kit fails to
build with lots of unresolved peer dependencies of PatternFly.
With an absolute path, `resolve.modules` will only look in that
directory; the default is a relative path "node_modules" that just
works [1]. Use that default, as we don't use `$SRCDIR` in this project
anyway.
[1] https://webpack.js.org/configuration/resolve/#resolvemodules
---
webpack.config.js | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/webpack.config.js b/webpack.config.js
index 0cc78d3..600e5ee 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -15,8 +15,6 @@ crypto.createHash = algorithm => crypto_orig_createHash(algorithm == "md4" ? "sh
const webpack = require("webpack");
-const nodedir = path.resolve((process.env.SRCDIR || __dirname), "node_modules");
-
/* A standard nodejs and webpack pattern */
const production = process.env.NODE_ENV === 'production';
@@ -44,11 +42,11 @@ if (production) {
module.exports = {
mode: production ? 'production' : 'development',
resolve: {
- modules: [ nodedir, path.resolve(__dirname, 'src/lib') ],
- alias: { 'font-awesome': path.resolve(nodedir, 'font-awesome-sass/assets/stylesheets') },
+ modules: [ "node_modules", path.resolve(__dirname, 'src/lib') ],
+ alias: { 'font-awesome': 'font-awesome-sass/assets/stylesheets' },
},
resolveLoader: {
- modules: [ nodedir, path.resolve(__dirname, 'src/lib') ],
+ modules: [ "node_modules", path.resolve(__dirname, 'src/lib') ],
},
watchOptions: {
ignored: /node_modules/,
From 4e0dce1ca60978a3b8ab0d4768dc907ea890da91 Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Wed, 13 Oct 2021 02:34:58 +0000
Subject: [PATCH 279/942] package.json: Update core-js
Closes #502
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 4e11d66..645bd98 100644
--- a/package.json
+++ b/package.json
@@ -50,7 +50,7 @@
"dependencies": {
"@patternfly/patternfly": "4.135.2",
"@patternfly/react-core": "4.157.3",
- "core-js": "3.18.2",
+ "core-js": "3.18.3",
"react": "16.14.0",
"react-dom": "16.14.0"
}
From 0a022058692061b21f8b8ecf287dd1b341a31561 Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Fri, 15 Oct 2021 02:33:08 +0000
Subject: [PATCH 280/942] package.json: Update @patternfly/patternfly,
@patternfly/react-core
Closes #503
---
package.json | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/package.json b/package.json
index 645bd98..73b8dc7 100644
--- a/package.json
+++ b/package.json
@@ -48,8 +48,8 @@
"webpack-cli": "^4.6.0"
},
"dependencies": {
- "@patternfly/patternfly": "4.135.2",
- "@patternfly/react-core": "4.157.3",
+ "@patternfly/patternfly": "4.144.5",
+ "@patternfly/react-core": "4.162.3",
"core-js": "3.18.3",
"react": "16.14.0",
"react-dom": "16.14.0"
From f8024eb1f02af57de13128c93ad88f0c355e8ebd Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Tue, 26 Oct 2021 02:32:08 +0000
Subject: [PATCH 281/942] package.json: Update core-js
Closes #504
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 73b8dc7..23ac0a3 100644
--- a/package.json
+++ b/package.json
@@ -50,7 +50,7 @@
"dependencies": {
"@patternfly/patternfly": "4.144.5",
"@patternfly/react-core": "4.162.3",
- "core-js": "3.18.3",
+ "core-js": "3.19.0",
"react": "16.14.0",
"react-dom": "16.14.0"
}
From a302255b3a3569cfcf4b325ef0393cbc37849d1c Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Sat, 30 Oct 2021 02:32:29 +0000
Subject: [PATCH 282/942] package.json: Update @patternfly/patternfly,
@patternfly/react-core
Closes #505
---
package.json | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/package.json b/package.json
index 23ac0a3..27b83a7 100644
--- a/package.json
+++ b/package.json
@@ -48,8 +48,8 @@
"webpack-cli": "^4.6.0"
},
"dependencies": {
- "@patternfly/patternfly": "4.144.5",
- "@patternfly/react-core": "4.162.3",
+ "@patternfly/patternfly": "4.151.4",
+ "@patternfly/react-core": "4.168.8",
"core-js": "3.19.0",
"react": "16.14.0",
"react-dom": "16.14.0"
From 3536eafd5a4b44925c41c54360ec5d1839b34d7f Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Wed, 3 Nov 2021 02:32:26 +0000
Subject: [PATCH 283/942] package.json: Update core-js
Closes #506
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 27b83a7..a1ed7e2 100644
--- a/package.json
+++ b/package.json
@@ -50,7 +50,7 @@
"dependencies": {
"@patternfly/patternfly": "4.151.4",
"@patternfly/react-core": "4.168.8",
- "core-js": "3.19.0",
+ "core-js": "3.19.1",
"react": "16.14.0",
"react-dom": "16.14.0"
}
From c04d951964a67ac7a1205d97f3fd333e2ad47ba3 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Tue, 16 Nov 2021 11:01:23 +0100
Subject: [PATCH 284/942] packit: Run tests on CentOS 9 stream
---
packit.yaml | 1 +
test/browser/run-test.sh | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/packit.yaml b/packit.yaml
index 4a8f605..15f9f1e 100644
--- a/packit.yaml
+++ b/packit.yaml
@@ -28,3 +28,4 @@ jobs:
targets:
- fedora-all
- centos-stream-8
+ - centos-stream-9
diff --git a/test/browser/run-test.sh b/test/browser/run-test.sh
index 0aee3c6..99b8029 100755
--- a/test/browser/run-test.sh
+++ b/test/browser/run-test.sh
@@ -24,8 +24,8 @@ mv .git dot-git
export TEST_OS="${ID}-${VERSION_ID/./-}"
export TEST_AUDIT_NO_SELINUX=1
-if [ "$TEST_OS" = "centos-8" ]; then
- TEST_OS=centos-8-stream
+if [ "${TEST_OS#centos-}" != "$TEST_OS" ]; then
+ TEST_OS="${TEST_OS}-stream"
fi
EXCLUDES=""
From 833326148fe07c5f64519f9537865b8a27f6f537 Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Fri, 19 Nov 2021 02:35:00 +0000
Subject: [PATCH 285/942] package.json: Update @patternfly/patternfly,
@patternfly/react-core
Closes #509
---
package.json | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/package.json b/package.json
index a1ed7e2..c40915d 100644
--- a/package.json
+++ b/package.json
@@ -48,8 +48,8 @@
"webpack-cli": "^4.6.0"
},
"dependencies": {
- "@patternfly/patternfly": "4.151.4",
- "@patternfly/react-core": "4.168.8",
+ "@patternfly/patternfly": "4.159.1",
+ "@patternfly/react-core": "4.175.4",
"core-js": "3.19.1",
"react": "16.14.0",
"react-dom": "16.14.0"
From 5966735547a7e8a39693b64c438c0eb5efd7b1bb Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Fri, 19 Nov 2021 09:37:33 +0100
Subject: [PATCH 286/942] po: Pick up also strings with specified context
Strings like `_("Context", "String to translate")` were not picked up.
Taken from https://github.com/cockpit-project/cockpit/commit/ba95d680d2
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index b869d58..dc2cf09 100644
--- a/Makefile
+++ b/Makefile
@@ -26,7 +26,7 @@ LINGUAS=$(basename $(notdir $(wildcard po/*.po)))
po/$(PACKAGE_NAME).js.pot:
xgettext --default-domain=cockpit --output=$@ --language=C --keyword= \
- --keyword=_:1,1t --keyword=_:1c,2,1t --keyword=C_:1c,2 \
+ --keyword=_:1,1t --keyword=_:1c,2,2t --keyword=C_:1c,2 \
--keyword=N_ --keyword=NC_:1c,2 \
--keyword=gettext:1,1t --keyword=gettext:1c,2,2t \
--keyword=ngettext:1,2,3t --keyword=ngettext:1c,2,3,4t \
From 4820c2b7403a3efa870d33c0f661d861f3835c56 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Mon, 29 Nov 2021 08:48:05 +0100
Subject: [PATCH 287/942] test: Adjust language changing for Cockpit 258
That version rewrote the Shell in React, the ids/classes changed.
---
test/check-application | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/test/check-application b/test/check-application
index 2a13ce3..7adf2cd 100755
--- a/test/check-application
+++ b/test/check-application
@@ -34,12 +34,17 @@ class TestApplication(testlib.MachineCase):
b.wait_in_text(".pf-c-alert__title", "Running on new-" + hostname)
# change language to German
+ # the menu and dialog changed several times
b.switch_to_top()
- b.click("#navbar-dropdown")
- b.click(".display-language-menu a")
- b.wait_popup('display-language')
- # the dialog changed several times
cockpit_version = float(m.execute("cockpit-bridge --version | sed -n '/Version:/ s/^.*: //p'").strip())
+ if cockpit_version >= 258:
+ b.click("#toggle-menu")
+ b.click(".display-language-menu")
+ b.wait_popup('display-language-modal')
+ else:
+ b.click("#navbar-dropdown")
+ b.click(".display-language-menu a")
+ b.wait_popup('display-language')
if cockpit_version >= 242:
b.click("#display-language-modal [data-value='de-de'] button")
b.click("#display-language-modal button.pf-m-primary")
From 67c1c065e913b0c7714215131bf64fc69b3a5856 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Mon, 29 Nov 2021 06:50:32 +0100
Subject: [PATCH 288/942] package.json: Drop core-js
starter-kit does not use it directly, and none of our derived projects
have it.
---
package.json | 1 -
src/index.js | 2 --
2 files changed, 3 deletions(-)
diff --git a/package.json b/package.json
index c40915d..41e5068 100644
--- a/package.json
+++ b/package.json
@@ -50,7 +50,6 @@
"dependencies": {
"@patternfly/patternfly": "4.159.1",
"@patternfly/react-core": "4.175.4",
- "core-js": "3.19.1",
"react": "16.14.0",
"react-dom": "16.14.0"
}
diff --git a/src/index.js b/src/index.js
index 11a1c9c..a0e5c45 100644
--- a/src/index.js
+++ b/src/index.js
@@ -19,8 +19,6 @@
import "./lib/patternfly/patternfly-4-cockpit.scss";
-import "core-js/stable";
-
import React from 'react';
import ReactDOM from 'react-dom';
import { Application } from './app.jsx';
From 11ff944f2ccad1e9a2dd1bce892415577ff2ba2e Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Mon, 29 Nov 2021 06:57:45 +0100
Subject: [PATCH 289/942] package.json: Update various development packages
These work without any source changes.
Don't update copy-webpack-plugin to the latest 10 major release, but
keep it at 9. 10 breaks compatibility with node.js 10, but that is still
the default in CentOS 8 stream (and we can't select the newer modules in
the spec or packit.yml).
---
package.json | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/package.json b/package.json
index 41e5068..0f73892 100644
--- a/package.json
+++ b/package.json
@@ -17,10 +17,10 @@
"@babel/preset-env": "^7.5.4",
"@babel/preset-react": "^7.0.0",
"babel-loader": "^8.0.6",
- "chrome-remote-interface": "^0.28.0",
- "compression-webpack-plugin": "^6.0.0",
- "copy-webpack-plugin": "^6.1.0",
- "css-loader": "^5.2.0",
+ "chrome-remote-interface": "^0.31.0",
+ "compression-webpack-plugin": "^9.0.0",
+ "copy-webpack-plugin": "^9.0.0",
+ "css-loader": "^6.5.0",
"css-minimizer-webpack-plugin": "^3.0.1",
"eslint": "^7.10.0",
"eslint-config-standard": "^14.1.1",
@@ -35,7 +35,7 @@
"eslint-webpack-plugin": "^2.5.3",
"htmlparser": "^1.7.7",
"jed": "^1.1.1",
- "mini-css-extract-plugin": "^0.11.0",
+ "mini-css-extract-plugin": "^2.4.5",
"po2json": "^1.0.0-alpha",
"qunit": "^2.9.3",
"sass": "^1.35.2",
From 150e59c54890774b9a9a1f4c67ca5c2d30a3b11f Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Mon, 29 Nov 2021 07:14:45 +0100
Subject: [PATCH 290/942] package.json: Update React to 17
---
package.json | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/package.json b/package.json
index 0f73892..ef8ba5f 100644
--- a/package.json
+++ b/package.json
@@ -50,7 +50,7 @@
"dependencies": {
"@patternfly/patternfly": "4.159.1",
"@patternfly/react-core": "4.175.4",
- "react": "16.14.0",
- "react-dom": "16.14.0"
+ "react": "17.0.2",
+ "react-dom": "17.0.2"
}
}
From aa8308c3800defe77aaa6d4c1b5a326fb600f156 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Mon, 29 Nov 2021 09:58:18 +0100
Subject: [PATCH 291/942] test: Drop obsolete language switcher cases
The oldest release which we support is 251 from RHEL/CentOS 8.5, so we
don't need the older cases any more. Also move to
MachineCase.system_before().
---
test/check-application | 22 +++++++---------------
1 file changed, 7 insertions(+), 15 deletions(-)
diff --git a/test/check-application b/test/check-application
index 7adf2cd..3b7ec27 100755
--- a/test/check-application
+++ b/test/check-application
@@ -34,26 +34,18 @@ class TestApplication(testlib.MachineCase):
b.wait_in_text(".pf-c-alert__title", "Running on new-" + hostname)
# change language to German
- # the menu and dialog changed several times
b.switch_to_top()
- cockpit_version = float(m.execute("cockpit-bridge --version | sed -n '/Version:/ s/^.*: //p'").strip())
- if cockpit_version >= 258:
- b.click("#toggle-menu")
- b.click(".display-language-menu")
- b.wait_popup('display-language-modal')
- else:
+ # the menu and dialog changed several times
+ if self.system_before(258):
b.click("#navbar-dropdown")
b.click(".display-language-menu a")
b.wait_popup('display-language')
- if cockpit_version >= 242:
- b.click("#display-language-modal [data-value='de-de'] button")
- b.click("#display-language-modal button.pf-m-primary")
- elif cockpit_version >= 233:
- b.set_val("#display-language-modal select", "de-de")
- b.click("#display-language-modal button.pf-m-primary")
else:
- b.set_val("#display-language select", "de-de")
- b.click("#display-language-select-button")
+ b.click("#toggle-menu")
+ b.click(".display-language-menu")
+ b.wait_popup('display-language-modal')
+ b.click("#display-language-modal [data-value='de-de'] button")
+ b.click("#display-language-modal button.pf-m-primary")
b.expect_load()
# HACK: work around language switching in Chrome not working in current session (Cockpit issue #8160)
b.reload(ignore_cache=True)
From db6397050a92d2295c8c4d3a95c5e23c8b372011 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Tue, 14 Dec 2021 08:47:04 +0100
Subject: [PATCH 292/942] webpack: Drop unused import
See https://github.com/cockpit-project/cockpit-podman/issues/855
---
webpack.config.js | 2 --
1 file changed, 2 deletions(-)
diff --git a/webpack.config.js b/webpack.config.js
index 600e5ee..667a58c 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -13,8 +13,6 @@ const crypto = require("crypto");
const crypto_orig_createHash = crypto.createHash;
crypto.createHash = algorithm => crypto_orig_createHash(algorithm == "md4" ? "sha256" : algorithm);
-const webpack = require("webpack");
-
/* A standard nodejs and webpack pattern */
const production = process.env.NODE_ENV === 'production';
From 7e2f3d2b5ca7142a336c763588da4e334c0d261a Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Tue, 14 Dec 2021 09:13:48 +0100
Subject: [PATCH 293/942] webpack: Drop obsolete md4 hash hack
webpack 5.54 solved this properly, bump the dependency.
---
package.json | 4 ++--
webpack.config.js | 5 -----
2 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/package.json b/package.json
index ef8ba5f..ae24af9 100644
--- a/package.json
+++ b/package.json
@@ -44,8 +44,8 @@
"stdio": "^2.1.0",
"string-replace-loader": "^3.0.0",
"terser-webpack-plugin": "^5.1.4",
- "webpack": "^5.31.0",
- "webpack-cli": "^4.6.0"
+ "webpack": "^5.54.0",
+ "webpack-cli": "^4.9.1"
},
"dependencies": {
"@patternfly/patternfly": "4.159.1",
diff --git a/webpack.config.js b/webpack.config.js
index 667a58c..5c2bdd4 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -8,11 +8,6 @@ const CompressionPlugin = require("compression-webpack-plugin");
const ESLintPlugin = require('eslint-webpack-plugin');
const CockpitPoPlugin = require("./src/lib/cockpit-po-plugin");
-// HACK: OpenSSL 3 does not support md4 any more, but webpack hardcodes it all over the place: https://github.com/webpack/webpack/issues/13572
-const crypto = require("crypto");
-const crypto_orig_createHash = crypto.createHash;
-crypto.createHash = algorithm => crypto_orig_createHash(algorithm == "md4" ? "sha256" : algorithm);
-
/* A standard nodejs and webpack pattern */
const production = process.env.NODE_ENV === 'production';
From 7be9253229b71c98cfd0771a38c226d8d01f05e1 Mon Sep 17 00:00:00 2001
From: Garrett LeSage
Date: Tue, 14 Dec 2021 11:56:23 +0100
Subject: [PATCH 294/942] Fix spelling error found by codespell
---
.github/workflows/livetest.yml.disabled | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/livetest.yml.disabled b/.github/workflows/livetest.yml.disabled
index 37d4ea4..097a5c0 100644
--- a/.github/workflows/livetest.yml.disabled
+++ b/.github/workflows/livetest.yml.disabled
@@ -73,7 +73,7 @@ jobs:
run: make && sudo make install
- name: Create a new test user
- # WARNING: if you want to add this users to sudoers make sure to propertly delete the SINK_SSHRELAY_PRIVATE
+ # WARNING: if you want to add this users to sudoers make sure to properly delete the SINK_SSHRELAY_PRIVATE
run: sudo useradd --create-home livetest; echo livetest:foobar | sudo chpasswd
- name: Get the commit SHA that triggered the workflow
From 9e162423ebac0bb9dcc0769000fee1a873cd9f5d Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Wed, 15 Dec 2021 07:50:02 +0100
Subject: [PATCH 295/942] fmf: Go back to firefox distro version
By now the packaged firefox contains CDP. This makes the tests more
robust against CDP breakage in nightly.
---
test/browser/browser.sh | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/test/browser/browser.sh b/test/browser/browser.sh
index ca90003..ce9509d 100755
--- a/test/browser/browser.sh
+++ b/test/browser/browser.sh
@@ -12,12 +12,9 @@ LOGS="$(pwd)/logs"
mkdir -p "$LOGS"
chmod a+w "$LOGS"
-# install firefox (available everywhere in Fedora and RHEL); install the package to pull in all the dependencies
+# install firefox (available everywhere in Fedora and RHEL)
# we don't need the H.264 codec, and it is sometimes not available (rhbz#2005760)
dnf install --disablerepo=fedora-cisco-openh264 -y firefox
-# install nightly for Chrome DevTools Protocol support
-curl --location 'https://download.mozilla.org/?product=firefox-nightly-latest-ssl&os=linux64&lang=en-US' | tar -C /usr/local/lib/ -xj
-ln -s /usr/local/lib/firefox/firefox /usr/local/bin/
# create user account for logging in
if ! id admin 2>/dev/null; then
From 2e17e9a79ba35e5ebc25b857fbd6b9113ea3ebfc Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Wed, 15 Dec 2021 02:37:27 +0000
Subject: [PATCH 296/942] package.json: Update @patternfly/patternfly,
@patternfly/react-core
Closes #518
---
package.json | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/package.json b/package.json
index ae24af9..04d0c43 100644
--- a/package.json
+++ b/package.json
@@ -48,8 +48,8 @@
"webpack-cli": "^4.9.1"
},
"dependencies": {
- "@patternfly/patternfly": "4.159.1",
- "@patternfly/react-core": "4.175.4",
+ "@patternfly/patternfly": "4.164.2",
+ "@patternfly/react-core": "4.181.1",
"react": "17.0.2",
"react-dom": "17.0.2"
}
From ba3913caa0b7ade66a79789b3c3e1debf9f04822 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Wed, 15 Dec 2021 11:07:33 +0100
Subject: [PATCH 297/942] fmf: Work around missing /etc/nsswitch.conf in Fedora
Rawhide
Upgrading glibc in Rawhide now (semi-intentionally) removes
/etc/nsswitch.conf, but does not enforce installing a new enough
pam/authselect to ensure that it gets re-added. This breaks resolving
"localhost".
Reported as https://bugzilla.redhat.com/show_bug.cgi?id=2033020
---
test/browser/browser.sh | 3 +++
1 file changed, 3 insertions(+)
diff --git a/test/browser/browser.sh b/test/browser/browser.sh
index ce9509d..cd88a9a 100755
--- a/test/browser/browser.sh
+++ b/test/browser/browser.sh
@@ -12,6 +12,9 @@ LOGS="$(pwd)/logs"
mkdir -p "$LOGS"
chmod a+w "$LOGS"
+# HACK: https://bugzilla.redhat.com/show_bug.cgi?id=2033020
+dnf update -y pam || true
+
# install firefox (available everywhere in Fedora and RHEL)
# we don't need the H.264 codec, and it is sometimes not available (rhbz#2005760)
dnf install --disablerepo=fedora-cisco-openh264 -y firefox
From 9662fb2ffc656547e2f918e86bd05e4734e61db4 Mon Sep 17 00:00:00 2001
From: Jelle van der Waa
Date: Tue, 4 Jan 2022 13:20:03 +0100
Subject: [PATCH 298/942] Add ability to rsync artifacts to a remote machine
Use the CockpitRsyncWebpack plugin to optionally rsync build code to a
remote machine, the destination is determined by looking at the
package.json's name field.
---
Makefile | 2 +-
README.md | 6 ++++++
webpack.config.js | 6 ++++++
3 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index dc2cf09..9590ee8 100644
--- a/Makefile
+++ b/Makefile
@@ -158,7 +158,7 @@ test/common:
# checkout Cockpit's PF/React/build library; again this has no API stability guarantee, so check out a stable tag
$(LIB_TEST):
flock Makefile sh -ec '\
- git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 253; \
+ git fetch --depth=1 https://github.com/cockpit-project/cockpit.git e224a0296cd25a448d70810a4c114bac574b82dd; \
git checkout --force FETCH_HEAD -- pkg/lib; \
git reset -- pkg/lib'
mv pkg/lib src/ && rmdir -p pkg
diff --git a/README.md b/README.md
index 73d76b3..488b781 100644
--- a/README.md
+++ b/README.md
@@ -43,6 +43,12 @@ or
$ make watch
+When developing against a virtual machine, webpack can also automatically upload
+the code changes by setting the `RSYNC` environment variable to
+the remote hostname.
+
+ $ RSYNC=c make watch
+
# Running eslint
Cockpit Starter Kit uses [ESLint](https://eslint.org/) to automatically check
diff --git a/webpack.config.js b/webpack.config.js
index 5c2bdd4..2e0bd0b 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -1,3 +1,4 @@
+const fs = require("fs");
const path = require("path");
const copy = require("copy-webpack-plugin");
@@ -7,10 +8,14 @@ const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
const CompressionPlugin = require("compression-webpack-plugin");
const ESLintPlugin = require('eslint-webpack-plugin');
const CockpitPoPlugin = require("./src/lib/cockpit-po-plugin");
+const CockpitRsyncPlugin = require("./src/lib/cockpit-rsync-plugin");
/* A standard nodejs and webpack pattern */
const production = process.env.NODE_ENV === 'production';
+// Obtain package name from package.json
+const packageJson = JSON.parse(fs.readFileSync('package.json'));
+
// Non-JS files which are copied verbatim to dist/
const copy_files = [
"./src/index.html",
@@ -22,6 +27,7 @@ const plugins = [
new extract({filename: "[name].css"}),
new ESLintPlugin({ extensions: ["js", "jsx"] }),
new CockpitPoPlugin(),
+ new CockpitRsyncPlugin({dest: packageJson.name}),
];
/* Only minimize when in production mode */
From a9b9484166fe8b6a3cfe9051a46748303be0ccc7 Mon Sep 17 00:00:00 2001
From: Jelle van der Waa
Date: Mon, 17 Jan 2022 10:25:45 +0100
Subject: [PATCH 299/942] webpack: Fail on eslint warnings
Ensures we don't merge code with eslint warnings.
---
webpack.config.js | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/webpack.config.js b/webpack.config.js
index 2e0bd0b..d7eebca 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -25,7 +25,10 @@ const copy_files = [
const plugins = [
new copy({ patterns: copy_files }),
new extract({filename: "[name].css"}),
- new ESLintPlugin({ extensions: ["js", "jsx"] }),
+ new ESLintPlugin({
+ extensions: ["js", "jsx"],
+ failOnWarning: true,
+ }),
new CockpitPoPlugin(),
new CockpitRsyncPlugin({dest: packageJson.name}),
];
From 96e9c669adc541301387a25a3b315dae44e0d541 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Mon, 17 Jan 2022 11:01:18 +0100
Subject: [PATCH 300/942] npm: Lock mini-css-extract-plugin at version 2.4.5
2.5 has an unintended API breakage:
https://github.com/webpack-contrib/mini-css-extract-plugin/issues/896
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 04d0c43..f11aa06 100644
--- a/package.json
+++ b/package.json
@@ -35,7 +35,7 @@
"eslint-webpack-plugin": "^2.5.3",
"htmlparser": "^1.7.7",
"jed": "^1.1.1",
- "mini-css-extract-plugin": "^2.4.5",
+ "mini-css-extract-plugin": "~2.4.5",
"po2json": "^1.0.0-alpha",
"qunit": "^2.9.3",
"sass": "^1.35.2",
From e066d630c6ea47c6f9a9dde1fa2f96f3ab56bc05 Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Sat, 29 Jan 2022 02:30:46 +0000
Subject: [PATCH 301/942] package.json: Update @patternfly/patternfly,
@patternfly/react-core
Closes #523
---
package.json | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/package.json b/package.json
index f11aa06..bc70155 100644
--- a/package.json
+++ b/package.json
@@ -48,8 +48,8 @@
"webpack-cli": "^4.9.1"
},
"dependencies": {
- "@patternfly/patternfly": "4.164.2",
- "@patternfly/react-core": "4.181.1",
+ "@patternfly/patternfly": "4.171.1",
+ "@patternfly/react-core": "4.192.15",
"react": "17.0.2",
"react-dom": "17.0.2"
}
From 9fce37f2155968d227b7af49f32a12550f07b116 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Fri, 4 Feb 2022 06:38:22 +0100
Subject: [PATCH 302/942] fmf: Don't install weak firefox dependencies
firefox pulls in half a desktop, we don't need any of these for a
headless test. This reduces the number packages from 133 (459 MB) to 66
(365 MB).
---
test/browser/browser.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/browser/browser.sh b/test/browser/browser.sh
index cd88a9a..e68e449 100755
--- a/test/browser/browser.sh
+++ b/test/browser/browser.sh
@@ -17,7 +17,7 @@ dnf update -y pam || true
# install firefox (available everywhere in Fedora and RHEL)
# we don't need the H.264 codec, and it is sometimes not available (rhbz#2005760)
-dnf install --disablerepo=fedora-cisco-openh264 -y firefox
+dnf install --disablerepo=fedora-cisco-openh264 -y --setopt=install_weak_deps=False firefox
# create user account for logging in
if ! id admin 2>/dev/null; then
From e0cb0f9a32e09219a873544400c7b42f0aeac647 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Fri, 4 Feb 2022 06:40:39 +0100
Subject: [PATCH 303/942] package.json: Bump mini-css-extract-plugin version
Update to the latest version. This reverts the hack in commit
96e9c669adc5413, the API was fixed in 2.5.1.
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index bc70155..9affe2b 100644
--- a/package.json
+++ b/package.json
@@ -35,7 +35,7 @@
"eslint-webpack-plugin": "^2.5.3",
"htmlparser": "^1.7.7",
"jed": "^1.1.1",
- "mini-css-extract-plugin": "~2.4.5",
+ "mini-css-extract-plugin": "^2.5.3",
"po2json": "^1.0.0-alpha",
"qunit": "^2.9.3",
"sass": "^1.35.2",
From 8eaa689491d285feeefa807db8e76fffb586d08f Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Fri, 4 Feb 2022 06:41:38 +0100
Subject: [PATCH 304/942] Bump cockpit lib and test to 262
Create test/reference-image as required by testlib 261.
---
Makefile | 4 ++--
test/reference-image | 1 +
2 files changed, 3 insertions(+), 2 deletions(-)
create mode 100644 test/reference-image
diff --git a/Makefile b/Makefile
index 9590ee8..9b6b686 100644
--- a/Makefile
+++ b/Makefile
@@ -151,14 +151,14 @@ bots:
# when you start a new project, use the latest release, and update it from time to time
test/common:
flock Makefile sh -ec '\
- git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 253; \
+ git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 262; \
git checkout --force FETCH_HEAD -- test/common; \
git reset test/common'
# checkout Cockpit's PF/React/build library; again this has no API stability guarantee, so check out a stable tag
$(LIB_TEST):
flock Makefile sh -ec '\
- git fetch --depth=1 https://github.com/cockpit-project/cockpit.git e224a0296cd25a448d70810a4c114bac574b82dd; \
+ git fetch --depth=1 https://github.com/cockpit-project/cockpit.git 262; \
git checkout --force FETCH_HEAD -- pkg/lib; \
git reset -- pkg/lib'
mv pkg/lib src/ && rmdir -p pkg
diff --git a/test/reference-image b/test/reference-image
new file mode 100644
index 0000000..c06d46d
--- /dev/null
+++ b/test/reference-image
@@ -0,0 +1 @@
+fedora-35
From 0493621504e58c2e116def56791950497887665c Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Fri, 4 Feb 2022 06:50:59 +0100
Subject: [PATCH 305/942] Makefile: Factorize rpm name
---
Makefile | 25 +++++++++++++------------
1 file changed, 13 insertions(+), 12 deletions(-)
diff --git a/Makefile b/Makefile
index 9b6b686..4130c9c 100644
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,14 @@
# extract name from package.json
PACKAGE_NAME := $(shell awk '/"name":/ {gsub(/[",]/, "", $$2); print $$2}' package.json)
+RPM_NAME := cockpit-$(PACKAGE_NAME)
VERSION := $(shell T=$$(git describe 2>/dev/null) || T=1; echo $$T | tr '-' '.')
ifeq ($(TEST_OS),)
TEST_OS = centos-8-stream
endif
export TEST_OS
-TARFILE=cockpit-$(PACKAGE_NAME)-$(VERSION).tar.xz
-NODE_CACHE=cockpit-$(PACKAGE_NAME)-node-$(VERSION).tar.xz
-RPMFILE=$(shell rpmspec -D"VERSION $(VERSION)" -q cockpit-$(PACKAGE_NAME).spec.in).rpm
+TARFILE=$(RPM_NAME)-$(VERSION).tar.xz
+NODE_CACHE=$(RPM_NAME)-node-$(VERSION).tar.xz
+RPMFILE=$(shell rpmspec -D"VERSION $(VERSION)" -q $(RPM_NAME).spec.in).rpm
VM_IMAGE=$(CURDIR)/test/images/$(TEST_OS)
# stamp file to check if/when npm install ran
NODE_MODULES_TEST=package-lock.json
@@ -63,7 +64,7 @@ watch:
clean:
rm -rf dist/
- [ ! -e cockpit-$(PACKAGE_NAME).spec.in ] || rm -f cockpit-$(PACKAGE_NAME).spec
+ rm -f $(RPM_NAME).spec
install: $(WEBPACK_TEST)
mkdir -p $(DESTDIR)/usr/share/cockpit/$(PACKAGE_NAME)
@@ -87,28 +88,28 @@ dist: $(TARFILE)
# pre-built dist/ (so it's not necessary) and ship packge-lock.json (so that
# node_modules/ can be reconstructed if necessary)
$(TARFILE): export NODE_ENV=production
-$(TARFILE): $(WEBPACK_TEST) cockpit-$(PACKAGE_NAME).spec
+$(TARFILE): $(WEBPACK_TEST) $(RPM_NAME).spec
if type appstream-util >/dev/null 2>&1; then appstream-util validate-relax --nonet *.metainfo.xml; fi
touch -r package.json $(NODE_MODULES_TEST)
touch dist/*
- tar --xz -cf cockpit-$(PACKAGE_NAME)-$(VERSION).tar.xz --transform 's,^,cockpit-$(PACKAGE_NAME)/,' \
- --exclude cockpit-$(PACKAGE_NAME).spec.in --exclude node_modules \
- $$(git ls-files) src/lib package-lock.json cockpit-$(PACKAGE_NAME).spec dist/
+ tar --xz -cf $(TARFILE) --transform 's,^,$(RPM_NAME)/,' \
+ --exclude $(RPM_NAME).spec.in --exclude node_modules \
+ $$(git ls-files) src/lib package-lock.json $(RPM_NAME).spec dist/
$(NODE_CACHE): $(NODE_MODULES_TEST)
tar --xz -cf $@ node_modules
node-cache: $(NODE_CACHE)
-srpm: $(TARFILE) $(NODE_CACHE) cockpit-$(PACKAGE_NAME).spec
+srpm: $(TARFILE) $(NODE_CACHE) $(RPM_NAME).spec
rpmbuild -bs \
--define "_sourcedir `pwd`" \
--define "_srcrpmdir `pwd`" \
- cockpit-$(PACKAGE_NAME).spec
+ $(RPM_NAME).spec
rpm: $(RPMFILE)
-$(RPMFILE): $(TARFILE) $(NODE_CACHE) cockpit-$(PACKAGE_NAME).spec
+$(RPMFILE): $(TARFILE) $(NODE_CACHE) $(RPM_NAME).spec
mkdir -p "`pwd`/output"
mkdir -p "`pwd`/rpmbuild"
rpmbuild -bb \
@@ -118,7 +119,7 @@ $(RPMFILE): $(TARFILE) $(NODE_CACHE) cockpit-$(PACKAGE_NAME).spec
--define "_srcrpmdir `pwd`" \
--define "_rpmdir `pwd`/output" \
--define "_buildrootdir `pwd`/build" \
- cockpit-$(PACKAGE_NAME).spec
+ $(RPM_NAME).spec
find `pwd`/output -name '*.rpm' -printf '%f\n' -exec mv {} . \;
rm -r "`pwd`/rpmbuild"
rm -r "`pwd`/output" "`pwd`/build"
From 799d8f5cc9400b75842d1bb3c5961f982780f433 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Fri, 4 Feb 2022 06:53:35 +0100
Subject: [PATCH 306/942] Move spec file into packaging/
This is cleaner once projects add debian and arch packaging.
Factorize the spec name/path in the Makefile.
---
Makefile | 21 ++++++++++---------
.../cockpit-starter-kit.spec.in | 0
2 files changed, 11 insertions(+), 10 deletions(-)
rename cockpit-starter-kit.spec.in => packaging/cockpit-starter-kit.spec.in (100%)
diff --git a/Makefile b/Makefile
index 4130c9c..9ae9f3d 100644
--- a/Makefile
+++ b/Makefile
@@ -8,7 +8,8 @@ endif
export TEST_OS
TARFILE=$(RPM_NAME)-$(VERSION).tar.xz
NODE_CACHE=$(RPM_NAME)-node-$(VERSION).tar.xz
-RPMFILE=$(shell rpmspec -D"VERSION $(VERSION)" -q $(RPM_NAME).spec.in).rpm
+SPEC=$(RPM_NAME).spec
+RPMFILE=$(shell rpmspec -D"VERSION $(VERSION)" -q packaging/$(SPEC).in).rpm
VM_IMAGE=$(CURDIR)/test/images/$(TEST_OS)
# stamp file to check if/when npm install ran
NODE_MODULES_TEST=package-lock.json
@@ -53,7 +54,7 @@ update-po: po/$(PACKAGE_NAME).pot
# Build/Install/dist
#
-%.spec: %.spec.in
+%.spec: packaging/%.spec.in
sed -e 's/%{VERSION}/$(VERSION)/g' $< > $@
$(WEBPACK_TEST): $(NODE_MODULES_TEST) $(LIB_TEST) $(shell find src/ -type f) package.json webpack.config.js
@@ -64,7 +65,7 @@ watch:
clean:
rm -rf dist/
- rm -f $(RPM_NAME).spec
+ rm -f $(SPEC)
install: $(WEBPACK_TEST)
mkdir -p $(DESTDIR)/usr/share/cockpit/$(PACKAGE_NAME)
@@ -88,28 +89,28 @@ dist: $(TARFILE)
# pre-built dist/ (so it's not necessary) and ship packge-lock.json (so that
# node_modules/ can be reconstructed if necessary)
$(TARFILE): export NODE_ENV=production
-$(TARFILE): $(WEBPACK_TEST) $(RPM_NAME).spec
+$(TARFILE): $(WEBPACK_TEST) $(SPEC)
if type appstream-util >/dev/null 2>&1; then appstream-util validate-relax --nonet *.metainfo.xml; fi
touch -r package.json $(NODE_MODULES_TEST)
touch dist/*
tar --xz -cf $(TARFILE) --transform 's,^,$(RPM_NAME)/,' \
- --exclude $(RPM_NAME).spec.in --exclude node_modules \
- $$(git ls-files) src/lib package-lock.json $(RPM_NAME).spec dist/
+ --exclude packaging/$(SPEC).in --exclude node_modules \
+ $$(git ls-files) src/lib package-lock.json $(SPEC) dist/
$(NODE_CACHE): $(NODE_MODULES_TEST)
tar --xz -cf $@ node_modules
node-cache: $(NODE_CACHE)
-srpm: $(TARFILE) $(NODE_CACHE) $(RPM_NAME).spec
+srpm: $(TARFILE) $(NODE_CACHE) $(SPEC)
rpmbuild -bs \
--define "_sourcedir `pwd`" \
--define "_srcrpmdir `pwd`" \
- $(RPM_NAME).spec
+ $(SPEC)
rpm: $(RPMFILE)
-$(RPMFILE): $(TARFILE) $(NODE_CACHE) $(RPM_NAME).spec
+$(RPMFILE): $(TARFILE) $(NODE_CACHE) $(SPEC)
mkdir -p "`pwd`/output"
mkdir -p "`pwd`/rpmbuild"
rpmbuild -bb \
@@ -119,7 +120,7 @@ $(RPMFILE): $(TARFILE) $(NODE_CACHE) $(RPM_NAME).spec
--define "_srcrpmdir `pwd`" \
--define "_rpmdir `pwd`/output" \
--define "_buildrootdir `pwd`/build" \
- $(RPM_NAME).spec
+ $(SPEC)
find `pwd`/output -name '*.rpm' -printf '%f\n' -exec mv {} . \;
rm -r "`pwd`/rpmbuild"
rm -r "`pwd`/output" "`pwd`/build"
diff --git a/cockpit-starter-kit.spec.in b/packaging/cockpit-starter-kit.spec.in
similarity index 100%
rename from cockpit-starter-kit.spec.in
rename to packaging/cockpit-starter-kit.spec.in
From b2662eeebdb623395ca7d6ccacdd1c2746db7c42 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Fri, 4 Feb 2022 06:57:26 +0100
Subject: [PATCH 307/942] Use image-customize --build to build/install
distribution packages
This centralizes/factorizes the rpm package builds, and builds
RPM packages in the VM instead of on the host, which is cleaner. It also
paves the way for supporting Debian and arch builds.
Drop the `make srpm` rule, as it's not very useful. Keep the `make rpm`
rule, as sometimes developers do this manually. This might be replaced
later on with another image-customize feature which copies the built rpm
out of the VM.
---
Makefile | 24 ++++++++----------------
test/vm.install | 4 ++--
2 files changed, 10 insertions(+), 18 deletions(-)
diff --git a/Makefile b/Makefile
index 9ae9f3d..aab874c 100644
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,6 @@ export TEST_OS
TARFILE=$(RPM_NAME)-$(VERSION).tar.xz
NODE_CACHE=$(RPM_NAME)-node-$(VERSION).tar.xz
SPEC=$(RPM_NAME).spec
-RPMFILE=$(shell rpmspec -D"VERSION $(VERSION)" -q packaging/$(SPEC).in).rpm
VM_IMAGE=$(CURDIR)/test/images/$(TEST_OS)
# stamp file to check if/when npm install ran
NODE_MODULES_TEST=package-lock.json
@@ -102,15 +101,8 @@ $(NODE_CACHE): $(NODE_MODULES_TEST)
node-cache: $(NODE_CACHE)
-srpm: $(TARFILE) $(NODE_CACHE) $(SPEC)
- rpmbuild -bs \
- --define "_sourcedir `pwd`" \
- --define "_srcrpmdir `pwd`" \
- $(SPEC)
-
-rpm: $(RPMFILE)
-
-$(RPMFILE): $(TARFILE) $(NODE_CACHE) $(SPEC)
+# convenience target for developers
+rpm: $(TARFILE) $(NODE_CACHE) $(SPEC)
mkdir -p "`pwd`/output"
mkdir -p "`pwd`/rpmbuild"
rpmbuild -bb \
@@ -124,13 +116,13 @@ $(RPMFILE): $(TARFILE) $(NODE_CACHE) $(SPEC)
find `pwd`/output -name '*.rpm' -printf '%f\n' -exec mv {} . \;
rm -r "`pwd`/rpmbuild"
rm -r "`pwd`/output" "`pwd`/build"
- # sanity check
- test -e "$(RPMFILE)"
-# build a VM with locally built rpm installed
-$(VM_IMAGE): $(RPMFILE) bots
+# build a VM with locally built distro pkgs installed
+$(VM_IMAGE): $(TARFILE) $(NODE_CACHE) bots
rm -f $(VM_IMAGE) $(VM_IMAGE).qcow2
- bots/image-customize -v -i cockpit-ws -i `pwd`/$(RPMFILE) -s $(CURDIR)/test/vm.install $(TEST_OS)
+ bots/image-customize --verbose --upload $(NODE_CACHE):/var/tmp/ --build $(TARFILE) \
+ --install cockpit-ws \
+ --script $(CURDIR)/test/vm.install $(TEST_OS)
# convenience target for the above
vm: $(VM_IMAGE)
@@ -172,4 +164,4 @@ $(NODE_MODULES_TEST): package.json
env -u NODE_ENV npm install
env -u NODE_ENV npm prune
-.PHONY: all clean install devel-install print-version dist node-cache srpm rpm check vm update-po
+.PHONY: all clean install devel-install print-version dist node-cache rpm check vm update-po
diff --git a/test/vm.install b/test/vm.install
index 55e548d..7f3d134 100644
--- a/test/vm.install
+++ b/test/vm.install
@@ -1,6 +1,6 @@
#!/bin/sh
-# image-customize script to enable cockpit in test VMs
-# The application RPM will be installed separately
+# image-customize script to prepare a bots VM for testing this application
+# The application package will be installed separately
set -eu
# don't force https:// (self-signed cert)
From 07784820fd7a5747773f91f0c9e5283dc7155bf9 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Mon, 7 Feb 2022 14:44:37 +0100
Subject: [PATCH 308/942] .gitignore: Ignore ./bots symlink as well
On developer systems, bots is commonly a symlink to a shared checkout,
accept non-directories as well. Also, only ignore it at the top level of
the project directory.
---
.gitignore | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.gitignore b/.gitignore
index 7e82360..0eebb31 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,7 +8,7 @@ dist/
/.vagrant
package-lock.json
Test*FAIL*
-bots/
+/bots
test/common/
test/images/
src/lib/
From e4732583a9372453c3e6e833bd69c97b5f5fa996 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Tue, 8 Feb 2022 10:06:04 +0100
Subject: [PATCH 309/942] Use image-customize's new --fresh function
See https://github.com/cockpit-project/bots/commit/468ee1b39e2
This avoids hardcoding the test image overlay paths.
---
Makefile | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index aab874c..7096d67 100644
--- a/Makefile
+++ b/Makefile
@@ -119,8 +119,7 @@ rpm: $(TARFILE) $(NODE_CACHE) $(SPEC)
# build a VM with locally built distro pkgs installed
$(VM_IMAGE): $(TARFILE) $(NODE_CACHE) bots
- rm -f $(VM_IMAGE) $(VM_IMAGE).qcow2
- bots/image-customize --verbose --upload $(NODE_CACHE):/var/tmp/ --build $(TARFILE) \
+ bots/image-customize --verbose --fresh --upload $(NODE_CACHE):/var/tmp/ --build $(TARFILE) \
--install cockpit-ws \
--script $(CURDIR)/test/vm.install $(TEST_OS)
From fdba1dc96c3eb577593b33cadfbc12245d1ff29e Mon Sep 17 00:00:00 2001
From: Katerina Koukiou
Date: Fri, 11 Feb 2022 14:43:28 +0100
Subject: [PATCH 310/942] Bump up eslint-config-standard-react and add fix for
the new warnings
This started giving errors like:
22:10 error 'Alert' is defined but never used no-unused-vars
Use eslint-plugin-react to improve the JSX usage, not just to silence this error.
---
.eslintrc.json | 2 +-
package.json | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/.eslintrc.json b/.eslintrc.json
index eaa27d8..9888bd8 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -4,7 +4,7 @@
"browser": true,
"es6": true
},
- "extends": ["eslint:recommended", "standard", "standard-react"],
+ "extends": ["eslint:recommended", "standard", "standard-react", "plugin:react/recommended"],
"parser": "@babel/eslint-parser",
"parserOptions": {
"ecmaVersion": "7",
diff --git a/package.json b/package.json
index 9affe2b..001d032 100644
--- a/package.json
+++ b/package.json
@@ -24,7 +24,7 @@
"css-minimizer-webpack-plugin": "^3.0.1",
"eslint": "^7.10.0",
"eslint-config-standard": "^14.1.1",
- "eslint-config-standard-react": "^9.2.0",
+ "eslint-config-standard-react": "^11.0.1",
"eslint-plugin-flowtype": "^5.2.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-node": "^11.1.0",
From 67640c7088eb72b5d6d1eaa771d957d8dfda80e4 Mon Sep 17 00:00:00 2001
From: Katerina Koukiou
Date: Fri, 11 Feb 2022 15:26:17 +0100
Subject: [PATCH 311/942] Install eslint-plugin-standard-jsx to align with what
main cockpit repo does
---
.eslintrc.json | 2 +-
package.json | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/.eslintrc.json b/.eslintrc.json
index 9888bd8..a1e52bc 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -4,7 +4,7 @@
"browser": true,
"es6": true
},
- "extends": ["eslint:recommended", "standard", "standard-react", "plugin:react/recommended"],
+ "extends": ["eslint:recommended", "standard", "standard-jsx", "standard-react"],
"parser": "@babel/eslint-parser",
"parserOptions": {
"ecmaVersion": "7",
diff --git a/package.json b/package.json
index 001d032..399c2d0 100644
--- a/package.json
+++ b/package.json
@@ -24,6 +24,7 @@
"css-minimizer-webpack-plugin": "^3.0.1",
"eslint": "^7.10.0",
"eslint-config-standard": "^14.1.1",
+ "eslint-config-standard-jsx": "^10.0.0",
"eslint-config-standard-react": "^11.0.1",
"eslint-plugin-flowtype": "^5.2.0",
"eslint-plugin-import": "^2.22.1",
From ea8b60624349d2ff3524e26d1db61a7d58de9938 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Tue, 15 Feb 2022 11:41:07 +0100
Subject: [PATCH 312/942] cockpituous: Update example koji/bodhi configs
We use the "rawhide" branch, "main" is just an alias (and less
descriptive). Also bump the release to Fedora 36.
---
cockpituous-release | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/cockpituous-release b/cockpituous-release
index 7aebbf1..86e26a5 100644
--- a/cockpituous-release
+++ b/cockpituous-release
@@ -23,9 +23,9 @@ job release-srpm -V
## Authenticate for pushing into Fedora dist-git
# cat ~/.fedora-password | kinit yourfedorauser@FEDORAPROJECT.ORG
## Do fedora builds for the tag, using tarball
-# job release-koji -k main
-# job release-koji f33
-# job release-bodhi F33
+# job release-koji rawhide
+# job release-koji f36
+# job release-bodhi F36
# These are likely the first of your release targets; but run them after Fedora uploads,
# so that failures there will fail the release early, before publishing on GitHub
From 052eb5d57a6d659edff30ad7ae8d60d0f2855408 Mon Sep 17 00:00:00 2001
From: Matej Marusak
Date: Mon, 21 Feb 2022 13:52:37 +0100
Subject: [PATCH 313/942] Allow disabling eslint checks for development
purposes
Sometimes developers want to quickly check if something work and there
is no need to style to eslint liking.
---
webpack.config.js | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/webpack.config.js b/webpack.config.js
index d7eebca..63e5dc6 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -13,6 +13,9 @@ const CockpitRsyncPlugin = require("./src/lib/cockpit-rsync-plugin");
/* A standard nodejs and webpack pattern */
const production = process.env.NODE_ENV === 'production';
+/* development options for faster iteration */
+const eslint = process.env.ESLINT !== '0';
+
// Obtain package name from package.json
const packageJson = JSON.parse(fs.readFileSync('package.json'));
@@ -25,14 +28,14 @@ const copy_files = [
const plugins = [
new copy({ patterns: copy_files }),
new extract({filename: "[name].css"}),
- new ESLintPlugin({
- extensions: ["js", "jsx"],
- failOnWarning: true,
- }),
new CockpitPoPlugin(),
new CockpitRsyncPlugin({dest: packageJson.name}),
];
+if (eslint) {
+ plugins.push(new ESLintPlugin({ extensions: ["js", "jsx"], failOnWarning: true, }));
+}
+
/* Only minimize when in production mode */
if (production) {
plugins.unshift(new CompressionPlugin({
From 90ae15d81248ea7f92818e8054bab8b288572b80 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Tue, 22 Feb 2022 12:14:07 +0100
Subject: [PATCH 314/942] test: Prepare VM image without networking
This ensures that we stay independent from any changes that go on in
online repositories, and our mock/pbuilders are sufficiently pre-cached.
Drop the explicit install of `cockpit-ws` -- all our bots images have it
pre-installed.
---
Makefile | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 7096d67..68e84c1 100644
--- a/Makefile
+++ b/Makefile
@@ -118,9 +118,10 @@ rpm: $(TARFILE) $(NODE_CACHE) $(SPEC)
rm -r "`pwd`/output" "`pwd`/build"
# build a VM with locally built distro pkgs installed
+# disable networking, VM images have mock/pbuilder with the common build dependencies pre-installed
$(VM_IMAGE): $(TARFILE) $(NODE_CACHE) bots
- bots/image-customize --verbose --fresh --upload $(NODE_CACHE):/var/tmp/ --build $(TARFILE) \
- --install cockpit-ws \
+ bots/image-customize --verbose --no-network --fresh \
+ --upload $(NODE_CACHE):/var/tmp/ --build $(TARFILE) \
--script $(CURDIR)/test/vm.install $(TEST_OS)
# convenience target for the above
From 3d0f11368014aaf5037deaa8d769738e736aee12 Mon Sep 17 00:00:00 2001
From: Cockpit Project
Date: Thu, 24 Feb 2022 02:40:31 +0000
Subject: [PATCH 315/942] package.json: Update @patternfly/patternfly,
@patternfly/react-core
Closes #533
---
package.json | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/package.json b/package.json
index 399c2d0..0de8563 100644
--- a/package.json
+++ b/package.json
@@ -49,8 +49,8 @@
"webpack-cli": "^4.9.1"
},
"dependencies": {
- "@patternfly/patternfly": "4.171.1",
- "@patternfly/react-core": "4.192.15",
+ "@patternfly/patternfly": "4.179.1",
+ "@patternfly/react-core": "4.198.5",
"react": "17.0.2",
"react-dom": "17.0.2"
}
From e10a8702a7f5011fd006eb77d96089cf56fb4a3a Mon Sep 17 00:00:00 2001
From: Pino Toscano
Date: Tue, 8 Mar 2022 19:44:38 +0100
Subject: [PATCH 316/942] spec: drop the debug_package %define
The generated RPM is noarch, so by definition has no binaries to extract
debug symbols from. Hence, drop the %define that makes RPM not error out
in case there are no debug symbols around (usually in archful binaries).
---
packaging/cockpit-starter-kit.spec.in | 2 --
1 file changed, 2 deletions(-)
diff --git a/packaging/cockpit-starter-kit.spec.in b/packaging/cockpit-starter-kit.spec.in
index ae9f021..7a0093c 100644
--- a/packaging/cockpit-starter-kit.spec.in
+++ b/packaging/cockpit-starter-kit.spec.in
@@ -13,8 +13,6 @@ BuildRequires: libappstream-glib
Requires: cockpit-system
-%define debug_package %{nil}
-
%description
Cockpit Starter Kit Example Module
From 19300113fc17c1064d3942b189ce75084a75a823 Mon Sep 17 00:00:00 2001
From: Pino Toscano
Date: Wed, 9 Mar 2022 08:27:20 +0100
Subject: [PATCH 317/942] po: do not hardcode the domain name
Use $(PACKAGE_NAME) to represent the current project.
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 68e84c1..442fc22 100644
--- a/Makefile
+++ b/Makefile
@@ -26,7 +26,7 @@ all: $(WEBPACK_TEST)
LINGUAS=$(basename $(notdir $(wildcard po/*.po)))
po/$(PACKAGE_NAME).js.pot:
- xgettext --default-domain=cockpit --output=$@ --language=C --keyword= \
+ xgettext --default-domain=$(PACKAGE_NAME) --output=$@ --language=C --keyword= \
--keyword=_:1,1t --keyword=_:1c,2,2t --keyword=C_:1c,2 \
--keyword=N_ --keyword=NC_:1c,2 \
--keyword=gettext:1,1t --keyword=gettext:1c,2,2t \
From b5969c1c9b48f4f5d5dcefdbb306c61741cd2b78 Mon Sep 17 00:00:00 2001
From: Pino Toscano
Date: Tue, 8 Mar 2022 18:56:06 +0100
Subject: [PATCH 318/942] po: extract messages also for metainfo files
Recent versions of gettext know how to extract messages also from XML
files such as AppStream metadata. Hence, extract their messages, and
append them together with the global message catalog.
---
Makefile | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 442fc22..37defb7 100644
--- a/Makefile
+++ b/Makefile
@@ -40,7 +40,10 @@ po/$(PACKAGE_NAME).html.pot: $(NODE_MODULES_TEST)
po/$(PACKAGE_NAME).manifest.pot: $(NODE_MODULES_TEST)
po/manifest2po src/manifest.json -o $@
-po/$(PACKAGE_NAME).pot: po/$(PACKAGE_NAME).html.pot po/$(PACKAGE_NAME).js.pot po/$(PACKAGE_NAME).manifest.pot
+po/$(PACKAGE_NAME).metainfo.pot: org.cockpit-project.$(PACKAGE_NAME).metainfo.xml
+ xgettext --default-domain=$(PACKAGE_NAME) --output=$@ $<
+
+po/$(PACKAGE_NAME).pot: po/$(PACKAGE_NAME).html.pot po/$(PACKAGE_NAME).js.pot po/$(PACKAGE_NAME).manifest.pot po/$(PACKAGE_NAME).metainfo.pot
msgcat --sort-output --output-file=$@ $^
# Update translations against current PO template
From 4377c4fe19ebe373da2a8d77fa2d75f12ca3dc17 Mon Sep 17 00:00:00 2001
From: Pino Toscano
Date: Tue, 8 Mar 2022 19:07:20 +0100
Subject: [PATCH 319/942] po: merge translations for metainfo file
When installing the module, instead of copying the metainfo file to the
destination, merge the available translations for it. Since this is done
at install time, add gettext as BuildRequires for the RPM packaging;
add libappstream-glib-devel as well only on RHEL/CentOS 8, since it
contains the metainfo.its for gettext in order to handle .metainfo.xml
files.
This requires a LINGUAS file with the list of translations currently
available: this is the way msgfmt picks the available languages to
merge. Generate it dynamically from the list of available .po files.
---
.gitignore | 1 +
Makefile | 10 ++++++++--
packaging/cockpit-starter-kit.spec.in | 4 ++++
3 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/.gitignore b/.gitignore
index 0eebb31..e45fe25 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,3 +15,4 @@ src/lib/
*.pot
POTFILES*
tmp/
+/po/LINGUAS
diff --git a/Makefile b/Makefile
index 37defb7..7b3b841 100644
--- a/Makefile
+++ b/Makefile
@@ -46,6 +46,9 @@ po/$(PACKAGE_NAME).metainfo.pot: org.cockpit-project.$(PACKAGE_NAME).metainfo.xm
po/$(PACKAGE_NAME).pot: po/$(PACKAGE_NAME).html.pot po/$(PACKAGE_NAME).js.pot po/$(PACKAGE_NAME).manifest.pot po/$(PACKAGE_NAME).metainfo.pot
msgcat --sort-output --output-file=$@ $^
+po/LINGUAS:
+ echo $(LINGUAS) | tr ' ' '\n' > $@
+
# Update translations against current PO template
update-po: po/$(PACKAGE_NAME).pot
for lang in $(LINGUAS); do \
@@ -68,12 +71,15 @@ watch:
clean:
rm -rf dist/
rm -f $(SPEC)
+ rm -f po/LINGUAS
-install: $(WEBPACK_TEST)
+install: $(WEBPACK_TEST) po/LINGUAS
mkdir -p $(DESTDIR)/usr/share/cockpit/$(PACKAGE_NAME)
cp -r dist/* $(DESTDIR)/usr/share/cockpit/$(PACKAGE_NAME)
mkdir -p $(DESTDIR)/usr/share/metainfo/
- cp org.cockpit-project.$(PACKAGE_NAME).metainfo.xml $(DESTDIR)/usr/share/metainfo/
+ msgfmt --xml -d po \
+ --template org.cockpit-project.$(PACKAGE_NAME).metainfo.xml \
+ -o $(DESTDIR)/usr/share/metainfo/org.cockpit-project.$(PACKAGE_NAME).metainfo.xml
# this requires a built source tree and avoids having to install anything system-wide
devel-install: $(WEBPACK_TEST)
diff --git a/packaging/cockpit-starter-kit.spec.in b/packaging/cockpit-starter-kit.spec.in
index 7a0093c..8afadd9 100644
--- a/packaging/cockpit-starter-kit.spec.in
+++ b/packaging/cockpit-starter-kit.spec.in
@@ -10,6 +10,10 @@ BuildArch: noarch
BuildRequires: nodejs
BuildRequires: make
BuildRequires: libappstream-glib
+BuildRequires: gettext
+%if 0%{?rhel} && 0%{?rhel} <= 8
+BuildRequires: libappstream-glib-devel
+%endif
Requires: cockpit-system
From 6c123f94ec97d0367ad48695813c59603bb3b6c0 Mon Sep 17 00:00:00 2001
From: Martin Pitt
Date: Wed, 9 Mar 2022 16:12:30 +0100
Subject: [PATCH 320/942] po: Update German translations
This validates the i18n for the AppStream metadata introduced in commit
4377c4fe19.
---
po/de.po | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/po/de.po b/po/de.po
index 8d86d06..0394e91 100644
--- a/po/de.po
+++ b/po/de.po
@@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: starter-kit 1.0\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2018-08-29 00:14+0200\n"
+"POT-Creation-Date: 2022-03-09 16:09+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME