Skip to content

Commit

Permalink
Fixes to workflow and ember deprecations script
Browse files Browse the repository at this point in the history
  • Loading branch information
tyb-talks committed Jul 2, 2024
1 parent 5b32f7f commit a064910
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 97 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/discourse-plugin.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: Discourse Plugin

on:
push:
branches:
- main
pull_request:
# push:
# branches:
# - main
# pull_request:
workflow_dispatch:

jobs:
ci:
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/update-ember-deprecations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
ruby-version: '3.2'
bundler-cache: true

- name: Run deprecation script
run: ./scripts/update_ember_deprecations.rb
run: ruby ./scripts/update_ember_deprecations.rb

- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
Expand All @@ -25,7 +25,6 @@ jobs:
title: Update Ember Deprecations
body: |
This PR updates the list of Ember deprecations in the `deprecation-ids.yaml` file.
Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request).
branch: update-ember-deprecations
branch-suffix: timestamp
delete-branch: true
add-paths: ./lib/deprecation_collector/deprecation-ids.yml
84 changes: 0 additions & 84 deletions lib/deprecation_collector/deprecation-ids.yaml

This file was deleted.

85 changes: 85 additions & 0 deletions lib/deprecation_collector/deprecation-ids.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
ember_deprecation_ids:
- deprecate-implicit-route-model
discourse_deprecation_ids:
- discourse.pretty-text.registerOption
- discourse.add-flag-property
- discourse.add-header-icons
- discourse.add-header-panel
- discourse.add-toolbar-popup-menu-options-callback
- discourse.add-user-menu-glyph
- discourse.application-show-footer
- discourse.avatar-utils
- discourse.bootbox
- discourse.breadcrumbs.childCategories
- discourse.breadcrumbs.firstCategory
- discourse.breadcrumbs.parentCategories
- discourse.breadcrumbs.parentCategoriesSorted
- discourse.breadcrumbs.parentCategory
- discourse.breadcrumbs.secondCategory
- discourse.capitalize-string
- discourse.category-hashtags.categoryHashtagTriggerRule
- discourse.click-track.is-valid-link-jquery
- discourse.composer-controller.clear-popup-menu-options-callback
- discourse.composer.usernames
- discourse.createNewMessageViaParams
- discourse.createNewTopicViaParams
- discourse.current-theme-key
- discourse.custom_html_template
- discourse.d-button-action-string
- discourse.d-editor.on-toolbar-create
- discourse.d-popover
- discourse.d-section
- discourse.decorate-plugin-outlet
- discourse.decorate-topic-title
- discourse.formatter.update-relative-age-node-list
- discourse.get-owner-with-fallback
- discourse.global.site
- discourse.global.site-settings
- discourse.global.user
- discourse.globals.site
- discourse.globals.user
- discourse.hashtag.cleanUpHashtagTypeClasses
- discourse.hashtag.decorateHashtags
- discourse.hashtag.fetchUnseenHashtagsInContext
- discourse.hashtag.generatePlaceholderHashtagHTML
- discourse.hashtag.getHashtagTypeClasses
- discourse.hashtag.linkSeenHashtagsInContext
- discourse.hashtag.registerHashtagType
- discourse.header-extra-info.needs-second-row-if
- discourse.header-widget-overrides
- discourse.icon-renderer-translatedtitle
- discourse.inline-date
- discourse.lightbox.default-export
- discourse.link-hashtags.dom-node
- discourse.markdown-it.whitelist
- discourse.modal-controllers
- discourse.models-store
- discourse.nav-item.built-list-site-settings
- discourse.number-field
- discourse.open-topic-draft
- discourse.period-mixin
- discourse.plugin-connector.deprecated-arg
- discourse.plugin-outlet-args
- discourse.plugin-outlet-classic-hooks
- discourse.plugin-outlet-context-get
- discourse.plugin-outlet-parent-view
- discourse.plugin-outlet-tag-name
- discourse.post-stream.trigger-new-post
- discourse.qunit.acceptance-function
- discourse.qunit.global-exists
- discourse.register-connector-class-legacy
- discourse.register-unbound
- discourse.resolver-resolutions
- discourse.section-link-class-arg
- discourse.select-kit
- discourse.this-container
- discourse.topic.totalUnread
- discourse.uploads.display-error-for-upload
- discourse.user.userOptions
- discourse.user-menu.panel-component-class
- discourse.utils-decorators-import
- discourse.utils-decorators-observes
- discourse.utils-decorators-on
- discourse.hide-popover
- discourse.show-popover
9 changes: 7 additions & 2 deletions lib/deprecation_collector/list.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# frozen_string_literal: true
DEPRECATION_IDS_FILE = 'lib/deprecation_collector/deprecation-ids.yaml'

require "yaml"
module DeprecationCollector
DEPRECATION_IDS_FILE = "lib/deprecation_collector/deprecation-ids.yml"

deprecations = YAML.load_file(DEPRECATION_IDS_FILE)
List = (deprecations['ember_deprecation_ids'] || []).concat(deprecations['discourse_deprecation_ids'] || [])
List =
(deprecations["ember_deprecation_ids"] || []).concat(
deprecations["discourse_deprecation_ids"] || [],
)
end
7 changes: 4 additions & 3 deletions scripts/update_ember_deprecations.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# frozen_string_literal: true

require_relative "../lib/deprecation_collector/list"
require "yaml"
require "open-uri"

begin
deprecations = YAML.load_file(DeprecationCollector::DEPRECATION_IDS_FILE)
ember_deprecations = deprecations['ember_deprecation_ids'] || []
ember_deprecations = deprecations["ember_deprecation_ids"] || []

system("git", "clone", "-q", "https://github.com/ember-learn/deprecation-app", "--depth", "1")

Expand All @@ -19,9 +20,9 @@

return if ember_deprecations.sort == deprecation_ids.sort

deprecations['ember_deprecation_ids'] = deprecation_ids
deprecations["ember_deprecation_ids"] = deprecation_ids
File.write(DeprecationCollector::DEPRECATION_IDS_FILE, deprecations.to_yaml)
puts 'Updated ember deprecations'
puts "Updated ember deprecations"
ensure
system("rm", "-rf", "deprecation-app")
end

0 comments on commit a064910

Please sign in to comment.