- {{CommitUrl
+ {{commitUrl
"new"
@repo.latest.version
@repo.prettyLatestVersion
@@ -107,7 +110,7 @@ export default class RepoStatus extends Component {
}}
- {{NewCommits
+ {{newCommits
@repo.latest.commits_behind
@repo.version
@repo.latest.version
diff --git a/admin/assets/javascripts/discourse/controllers/update-index.js b/admin/assets/javascripts/discourse/controllers/update-index.js
index 99437c53..2e21177a 100644
--- a/admin/assets/javascripts/discourse/controllers/update-index.js
+++ b/admin/assets/javascripts/discourse/controllers/update-index.js
@@ -1,7 +1,7 @@
import { cached } from "@glimmer/tracking";
import Controller from "@ember/controller";
import { action } from "@ember/object";
-import { inject as service } from "@ember/service";
+import { service } from "@ember/service";
import { needsImageUpgrade } from "../models/repo";
export default class UpgradeIndex extends Controller {
diff --git a/admin/assets/javascripts/discourse/controllers/update-show.js b/admin/assets/javascripts/discourse/controllers/update-show.js
index d0e1b813..b55c0462 100644
--- a/admin/assets/javascripts/discourse/controllers/update-show.js
+++ b/admin/assets/javascripts/discourse/controllers/update-show.js
@@ -1,12 +1,11 @@
import Controller from "@ember/controller";
import { action } from "@ember/object";
-import { inject as service } from "@ember/service";
+import { service } from "@ember/service";
import { makeArray } from "discourse-common/lib/helpers";
-import I18n from "I18n";
+import I18n from "discourse-i18n";
import Repo from "../models/repo";
export default class UpgradeShow extends Controller {
- @service messageBus;
@service dialog;
@service upgradeStore;
diff --git a/admin/assets/javascripts/discourse/controllers/update.js b/admin/assets/javascripts/discourse/controllers/update.js
index 19c21c31..047979bc 100644
--- a/admin/assets/javascripts/discourse/controllers/update.js
+++ b/admin/assets/javascripts/discourse/controllers/update.js
@@ -4,8 +4,8 @@ import { action } from "@ember/object";
import { TrackedArray } from "@ember-compat/tracked-built-ins";
export default class Upgrade extends Controller {
- @tracked banner = new TrackedArray([]);
@tracked bannerDismissed = false;
+ banner = new TrackedArray();
get showBanner() {
if (this.bannerDismissed) {
diff --git a/admin/assets/javascripts/discourse/helpers/commit-url.js b/admin/assets/javascripts/discourse/helpers/commit-url.js
index 802e213c..5cb06496 100644
--- a/admin/assets/javascripts/discourse/helpers/commit-url.js
+++ b/admin/assets/javascripts/discourse/helpers/commit-url.js
@@ -10,7 +10,7 @@ export default function commitUrl(cssClass, version, prettyVersion, url) {
}
const repoUrl = url.substr(0, url.search(/(\.git)?$/));
- const description = `
${prettyVersion}`;
-
- return new htmlSafe(description);
+ return htmlSafe(
+ `
${prettyVersion}`
+ );
}
diff --git a/admin/assets/javascripts/discourse/helpers/new-commits.js b/admin/assets/javascripts/discourse/helpers/new-commits.js
index cdd944d8..a62e2201 100644
--- a/admin/assets/javascripts/discourse/helpers/new-commits.js
+++ b/admin/assets/javascripts/discourse/helpers/new-commits.js
@@ -1,10 +1,7 @@
-import { helper as buildHelper } from "@ember/component/helper";
import { htmlSafe } from "@ember/template";
-import I18n from "I18n";
-
-export default buildHelper(function (params) {
- const [commitsBehind, oldSha, newSha, url] = params;
+import I18n from "discourse-i18n";
+export default function newCommits(commitsBehind, oldSha, newSha, url) {
if (!commitsBehind) {
return "";
}
@@ -13,7 +10,7 @@ export default buildHelper(function (params) {
return "";
}
- let description = I18n.t("admin.docker.commits", {
+ const description = I18n.t("admin.docker.commits", {
count: commitsBehind,
});
@@ -22,7 +19,7 @@ export default buildHelper(function (params) {
}
const _url = url.substr(0, url.search(/(\.git)?$/));
- description = `
${description}`;
-
- return new htmlSafe(description);
-});
+ return htmlSafe(
+ `
${description}`
+ );
+}
diff --git a/admin/assets/javascripts/discourse/routes/update-show.js b/admin/assets/javascripts/discourse/routes/update-show.js
index a808069a..b515ccf1 100644
--- a/admin/assets/javascripts/discourse/routes/update-show.js
+++ b/admin/assets/javascripts/discourse/routes/update-show.js
@@ -1,5 +1,5 @@
import Route from "@ember/routing/route";
-import { inject as service } from "@ember/service";
+import { service } from "@ember/service";
import Repo from "../models/repo";
export default class UpgradeShow extends Route {
diff --git a/admin/assets/javascripts/discourse/routes/update.js b/admin/assets/javascripts/discourse/routes/update.js
index 008f5201..cd6c716b 100644
--- a/admin/assets/javascripts/discourse/routes/update.js
+++ b/admin/assets/javascripts/discourse/routes/update.js
@@ -1,7 +1,7 @@
import Route from "@ember/routing/route";
-import { inject as service } from "@ember/service";
+import { service } from "@ember/service";
import { bind } from "discourse-common/utils/decorators";
-import I18n from "I18n";
+import I18n from "discourse-i18n";
import Repo from "../models/repo";
export default class Upgrade extends Route {
diff --git a/admin/assets/javascripts/discourse/templates/update-processes.hbs b/admin/assets/javascripts/discourse/templates/update-processes.hbs
index 52f62091..356d78fc 100644
--- a/admin/assets/javascripts/discourse/templates/update-processes.hbs
+++ b/admin/assets/javascripts/discourse/templates/update-processes.hbs
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/lib/docker_manager/fallback_compatibility_parser.rb b/lib/docker_manager/fallback_compatibility_parser.rb
index 656c6605..7d0d0658 100644
--- a/lib/docker_manager/fallback_compatibility_parser.rb
+++ b/lib/docker_manager/fallback_compatibility_parser.rb
@@ -9,7 +9,7 @@ def self.find_compatible_resource(version_list, target_version = ::Discourse::VE
begin
version_list = YAML.safe_load(version_list)
- rescue Psych::SyntaxError, Psych::DisallowedClass => e
+ rescue Psych::SyntaxError, Psych::DisallowedClass
end
raise Discourse::InvalidVersionListError unless version_list.is_a?(Hash)
@@ -18,7 +18,7 @@ def self.find_compatible_resource(version_list, target_version = ::Discourse::VE
version_list
.transform_keys do |v|
Gem::Requirement.parse(v)
- rescue Gem::Requirement::BadRequirementError => e
+ rescue Gem::Requirement::BadRequirementError
raise Discourse::InvalidVersionListError, "Invalid version specifier: #{v}"
end
.sort_by do |parsed_requirement, _|
@@ -61,12 +61,12 @@ def self.find_compatible_resource(version_list, target_version = ::Discourse::VE
# Find a compatible resource from a git repo
def self.find_compatible_git_resource(path)
return unless File.directory?("#{path}/.git")
- compat_resource, std_error, s =
+ compat_resource, _, s =
Open3.capture3(
"git -C '#{path}' show HEAD@{upstream}:#{Discourse::VERSION_COMPATIBILITY_FILENAME}",
)
self.find_compatible_resource(compat_resource) if s.success?
- rescue Discourse::InvalidVersionListError => e
+ rescue Discourse::InvalidVersionListError
$stderr.puts "Invalid version list in #{path}"
end
end
diff --git a/lib/docker_manager/git_repo.rb b/lib/docker_manager/git_repo.rb
index ed7724fe..30e00a3c 100644
--- a/lib/docker_manager/git_repo.rb
+++ b/lib/docker_manager/git_repo.rb
@@ -178,7 +178,7 @@ def tracking_tag
def run(cmd)
@memoize[cmd] ||= begin
- stdout, stderr, status = Open3.capture3("git #{cmd}", chdir: path)
+ stdout, _, status = Open3.capture3("git #{cmd}", chdir: path)
status == 0 ? stdout.strip : nil
end
rescue => e
diff --git a/package.json b/package.json
index a4caa0b0..1872fa5e 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"private": true,
"devDependencies": {
- "@discourse/lint-configs": "1.3.10",
+ "@discourse/lint-configs": "1.4.2",
"ember-template-lint": "6.0.0",
"eslint": "8.57.1",
"prettier": "2.8.8",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 20857d47..a4213492 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -12,8 +12,8 @@ importers:
specifier: ^7.25.7
version: 7.25.7(@babel/core@7.25.8)
'@discourse/lint-configs':
- specifier: 1.3.10
- version: 1.3.10(ember-template-lint@6.0.0)(eslint@8.57.1)(prettier@2.8.8)
+ specifier: 1.4.2
+ version: 1.4.2(ember-template-lint@6.0.0)(eslint@8.57.1)(prettier@2.8.8)
ember-template-lint:
specifier: 6.0.0
version: 6.0.0
@@ -152,11 +152,11 @@ packages:
resolution: {integrity: sha512-JWtuCu8VQsMladxVz/P4HzHUGCAwpuqacmowgXFs5XjxIgKuNjnLokQzuVjlTvIzODaDmpjT3oxcC48vyk9EWg==}
engines: {node: '>=6.9.0'}
- '@discourse/lint-configs@1.3.10':
- resolution: {integrity: sha512-PQ56xx4UfceLR/wJm7ig1JRNKkLVYPAeyp5bV6k6jQhpVr9TeZdobeCfGbVtKG6hhuaQ4aECPjRf/MoNw00/cw==}
+ '@discourse/lint-configs@1.4.2':
+ resolution: {integrity: sha512-AhwEfqy7ByheuNEhioXlkcgrbvzQY8yFbSWwtqAB0GXsp4UNaMZFyjdMoPFgaUDdUzjY/eKFFZ/j4FkA9EY4qA==}
peerDependencies:
ember-template-lint: 6.0.0
- eslint: 8.57.0
+ eslint: 8.57.1
prettier: 2.8.8
'@ember-data/rfc395-data@0.0.4':
@@ -1947,7 +1947,7 @@ snapshots:
'@babel/helper-validator-identifier': 7.25.7
to-fast-properties: 2.0.0
- '@discourse/lint-configs@1.3.10(ember-template-lint@6.0.0)(eslint@8.57.1)(prettier@2.8.8)':
+ '@discourse/lint-configs@1.4.2(ember-template-lint@6.0.0)(eslint@8.57.1)(prettier@2.8.8)':
dependencies:
'@babel/core': 7.25.8
'@babel/eslint-parser': 7.25.8(@babel/core@7.25.8)(eslint@8.57.1)
diff --git a/spec/support/git_helpers.rb b/spec/support/git_helpers.rb
index 26e6fac0..f2f5d69d 100644
--- a/spec/support/git_helpers.rb
+++ b/spec/support/git_helpers.rb
@@ -195,7 +195,7 @@ def initialize(path, clone_method)
def git(*commands)
Dir.chdir(@path) do
commands.map do |command|
- stdout, stderr, status = Open3.capture3("git #{command}".strip)
+ stdout, _, status = Open3.capture3("git #{command}".strip)
status.success? ? stdout : (raise RuntimeError)
end
end
diff --git a/spec/system/admin_update_spec.rb b/spec/system/admin_update_spec.rb
index 2b759dd1..c9775367 100644
--- a/spec/system/admin_update_spec.rb
+++ b/spec/system/admin_update_spec.rb
@@ -8,7 +8,7 @@
before { sign_in(admin) }
- xit "displays the admin update page with the right respositories" do
+ xit "displays the admin update page with the right repositories" do
visit("/admin/update")
expect(page).to have_css("h3", exact_text: I18n.t("js.admin.docker.update_title"))
diff --git a/test/javascripts/integration/components/repo-status-test.js b/test/javascripts/integration/components/repo-status-test.js
index c4e957a7..5e20cc27 100644
--- a/test/javascripts/integration/components/repo-status-test.js
+++ b/test/javascripts/integration/components/repo-status-test.js
@@ -1,9 +1,8 @@
-import { getOwner } from "@ember/application";
+import { getOwner } from "@ember/owner";
import { render, settled } from "@ember/test-helpers";
import { setupRenderingTest } from "ember-qunit";
import hbs from "htmlbars-inline-precompile";
import { module, test } from "qunit";
-import { query } from "discourse/tests/helpers/qunit-helpers";
const repoProps = {
unloaded: false,
@@ -46,7 +45,7 @@ const managerProps = {
module("Integration | Component | RepoStatus", function (hooks) {
setupRenderingTest(hooks);
- test("it renders correctly", async function (assert) {
+ test("renders correctly", async function (assert) {
const store = getOwner(this).lookup("service:store");
this.set("repo", store.createRecord("repo", repoProps));
this.set("managerRepo", store.createRecord("repo", managerProps));
@@ -65,26 +64,24 @@ module("Integration | Component | RepoStatus", function (hooks) {
assert
.dom("div.new-commits a")
.hasText("3 new commits", "shows number of new commits");
- assert.strictEqual(
- query("div.new-commits a").href.trim(),
- "https://github.com/discourse/discourse/compare/8f65e4f...2b006c0",
- "links to GitHub diff page"
- );
+ assert
+ .dom("div.new-commits a")
+ .hasAttribute(
+ "href",
+ "https://github.com/discourse/discourse/compare/8f65e4f...2b006c0",
+ "links to GitHub diff page"
+ );
this.repo.pretty_version = null;
this.repo.latest.pretty_version = null;
await settled();
- assert.strictEqual(
- query("a.current.commit-hash").textContent.trim(),
- "8f65e4f",
- "commit hash is used when tag version is absent"
- );
- assert.strictEqual(
- query("a.new.commit-hash").textContent.trim(),
- "2b006c0",
- "commit hash is used when tag version is absent"
- );
+ assert
+ .dom("a.current.commit-hash")
+ .hasText("8f65e4f", "commit hash is used when tag version is absent");
+ assert
+ .dom("a.new.commit-hash")
+ .hasText("2b006c0", "commit hash is used when tag version is absent");
});
test("official plugin", async function (assert) {
@@ -97,11 +94,9 @@ module("Integration | Component | RepoStatus", function (hooks) {
hbs`
`
);
- assert.strictEqual(
- query("div.d-admin-row__overview-author").textContent.trim(),
- "By Discourse",
- "shows plugin author"
- );
+ assert
+ .dom("div.d-admin-row__overview-author")
+ .hasText("By Discourse", "shows plugin author");
});
test("update button", async function (assert) {