A platform for community discussion. Free, open, simple.
FIX: Limit what's new to the last 4 months (#39216)
Martin Brennan356416d69f9b
diff --git a/config/locales/client.en.yml b/config/locales/client.en.ymlindex ba32c32b6cf..72edd9f00d2 100644--- a/config/locales/client.en.yml+++ b/config/locales/client.en.yml@@ -6646,8 +6646,8 @@ en:new_features:title: "What's new?"subtitle: "We are releasing new features and improvements all the time. This page covers the highlights, but you can click 'Learn more' to see extensive release notes."- no_new_features_found: "There are no items in the feed or your selected filter returned no results. You can see previous new feature announcements on <a href='%{url}' target='_blank'>the Discourse Meta community</a>."- no_new_features_error: "There was an error loading the feed. You can see previous new feature announcements on <a href='%{url}' target='_blank'>the Discourse Meta community</a>."+ no_new_features_found: "There are no items in the feed or your selected filter returned no results. You can see previous new feature announcements on <a href='%{url}' target='_blank'>the Discourse Releases site</a>."+ no_new_features_error: "There was an error loading the feed. You can see previous new feature announcements on <a href='%{url}' target='_blank'>the Discourse Releases site</a>."learn_more: "Learn more..."last_checked: "Last checked"diff --git a/frontend/discourse/admin/components/dashboard-new-features.gjs b/frontend/discourse/admin/components/dashboard-new-features.gjsindex 1843f2b1e1e..5b50274c0fe 100644--- a/frontend/discourse/admin/components/dashboard-new-features.gjs+++ b/frontend/discourse/admin/components/dashboard-new-features.gjs@@ -77,13 +77,13 @@ export default class DashboardNewFeatures extends Component {get emptyLabel() {if (this.feedError) {return i18n("admin.dashboard.new_features.no_new_features_error", {- url: "https://meta.discourse.org/tags/c/announcements/67/release-notes",+ url: "https://releases.discourse.org/",});}if (this.groupedNewFeatures.length === 0) {return i18n("admin.dashboard.new_features.no_new_features_found", {- url: "https://meta.discourse.org/tags/c/announcements/67/release-notes",+ url: "https://releases.discourse.org/",});}diff --git a/frontend/discourse/admin/templates/admin/whats-new.gjs b/frontend/discourse/admin/templates/admin/whats-new.gjsindex cd8162a91ea..757a6a42614 100644--- a/frontend/discourse/admin/templates/admin/whats-new.gjs+++ b/frontend/discourse/admin/templates/admin/whats-new.gjs@@ -7,7 +7,7 @@ export default <template><DPageHeader@titleLabel={{i18n "admin.config.whats_new.title"}}@descriptionLabel={{i18n "admin.config.whats_new.header_description"}}- @learnMoreUrl="https://meta.discourse.org/tags/c/announcements/67/release-notes"+ @learnMoreUrl="https://releases.discourse.org/"@hideTabs={{true}}><:breadcrumbs>diff --git a/frontend/discourse/tests/acceptance/admin-whats-new-test.js b/frontend/discourse/tests/acceptance/admin-whats-new-test.jsindex f2cb170dfe0..aa8c4516bbc 100644--- a/frontend/discourse/tests/acceptance/admin-whats-new-test.js+++ b/frontend/discourse/tests/acceptance/admin-whats-new-test.js@@ -2,8 +2,7 @@ import { visit } from "@ember/test-helpers";import { test } from "qunit";import { acceptance } from "discourse/tests/helpers/qunit-helpers";-const RELEASE_NOTES_URL =- "https://meta.discourse.org/tags/c/announcements/67/release-notes";+const RELEASE_SITE_URL = "https://releases.discourse.org/";acceptance("Admin - What's New", function (needs) {needs.user();@@ -21,7 +20,7 @@ acceptance("Admin - What's New", function (needs) {assert.dom(".admin-config-area-empty-list").exists();assert- .dom(`.admin-config-area-empty-list a[href="${RELEASE_NOTES_URL}"]`)+ .dom(`.admin-config-area-empty-list a[href="${RELEASE_SITE_URL}"]`).exists();});});diff --git a/lib/discourse_updates.rb b/lib/discourse_updates.rbindex e7de700743d..6c7f6498b6c 100644--- a/lib/discourse_updates.rb+++ b/lib/discourse_updates.rb@@ -168,7 +168,11 @@ module DiscourseUpdatesdef new_features_response_jsonresponse =- Excon.new(new_features_endpoint).request(expects: [200], method: :Get, read_timeout: 5)+ Excon.new(new_features_full_endpoint_url).request(+ expects: [200],+ method: :Get,+ read_timeout: 5,+ )response.bodyend@@ -302,11 +306,21 @@ module DiscourseUpdates)end+ def new_features_full_endpoint_url+ "#{new_features_endpoint}#{new_features_endpoint_query_params}"+ end+def new_features_endpointreturn "https://meta.discourse.org/new-features.json" if Rails.env.production?ENV["DISCOURSE_NEW_FEATURES_ENDPOINT"] || "http://localhost:4200/new-features.json"end+ # We no longer delete new features on Meta, so we need to filter out old ones.+ # Maybe in future we can show even older ones in a separate Archived tab.+ def new_features_endpoint_query_params+ "?released_after=#{5.months.ago.end_of_month.to_date}"+ end+privatedef last_installed_version_keydiff --git a/spec/jobs/check_new_features_spec.rb b/spec/jobs/check_new_features_spec.rbindex 092ca4a02ab..c4d410e6fd9 100644--- a/spec/jobs/check_new_features_spec.rb+++ b/spec/jobs/check_new_features_spec.rb@@ -16,7 +16,7 @@ RSpec.describe Jobs::CheckNewFeatures doenddef stub_new_features_endpoint(*features)- stub_request(:get, DiscourseUpdates.new_features_endpoint).to_return(+ stub_request(:get, DiscourseUpdates.new_features_full_endpoint_url).to_return(status: 200,body: JSON.dump(features),headers: {