0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-06 13:08:40 +08:00
discourse/script
Martin Brennan 67d2410919
DEV: Fix UC status report when reverted files encountered (#41821)
Fixes the following error when generating the upcoming changes status
report
on a weekly basis in GitHub actions:

```
/__w/discourse/discourse/lib/upcoming_changes/status_report.rb:56:in 'UpcomingChanges::StatusReport::Git#capture': git show 45535887f1231b40f8a21b8c154e58cef8670063:plugins/discourse-workflows/config/settings.yml failed: fatal: path 'plugins/discourse-workflows/config/settings.yml' exists on disk, but not in '45535887f1' (RuntimeError)
	from /__w/discourse/discourse/lib/upcoming_changes/status_report.rb:47:in 'UpcomingChanges::StatusReport::Git#show_file'
	from /__w/discourse/discourse/lib/upcoming_changes/status_report.rb:227:in 'UpcomingChanges::StatusReport::GitHistory#statuses_at'
	from /__w/discourse/discourse/lib/upcoming_changes/status_report.rb:215:in 'block in UpcomingChanges::StatusReport::GitHistory#add_history_for_settings_file'
	from /__w/discourse/discourse/lib/upcoming_changes/status_report.rb:214:in 'Array#reverse_each'
	from /__w/discourse/discourse/lib/upcoming_changes/status_report.rb:214:in 'UpcomingChanges::StatusReport::GitHistory#add_history_for_settings_file'
	from /__w/discourse/discourse/lib/upcoming_changes/status_report.rb:205:in 'block in UpcomingChanges::StatusReport::GitHistory#by_change'
	from /__w/discourse/discourse/lib/upcoming_changes/status_report.rb:202:in 'Hash#each'
	from /__w/discourse/discourse/lib/upcoming_changes/status_report.rb:202:in 'Enumerable#each_with_object'
	from /__w/discourse/discourse/lib/upcoming_changes/status_report.rb:202:in 'UpcomingChanges::StatusReport::GitHistory#by_change'
	from /__w/discourse/discourse/lib/upcoming_changes/status_report.rb:422:in 'UpcomingChanges::StatusReport#history_by_change'
	from /__w/discourse/discourse/lib/upcoming_changes/status_report.rb:363:in 'block in UpcomingChanges::StatusReport#report'
	from /__w/discourse/discourse/lib/upcoming_changes/status_report.rb:362:in 'Hash#each'
	from /__w/discourse/discourse/lib/upcoming_changes/status_report.rb:362:in 'Enumerable#map'
	from /__w/discourse/discourse/lib/upcoming_changes/status_report.rb:362:in 'UpcomingChanges::StatusReport#report'
	from /__w/discourse/discourse/lib/upcoming_changes/status_report.rb:499:in 'UpcomingChanges::StatusReport::CLI.run'
	from /__w/discourse/discourse/script/upcoming_changes_status_report:9:in '<main>'
```

This happened because we were trying to run `git sho` on a file that was
reverted in a commit. Now, we check whether the file exists for the
specific commit hash before running git show, and continue with the
next valid commit for the file.
2026-07-20 16:37:35 +10:00
..
benchmarks
bulk_import MT: Ensure bulk-imported users are approved 2026-06-12 15:25:13 +02:00
demon_test
import_scripts DEV: Enable Style/RedundantSelf rubocop rule (#40098) 2026-05-19 19:27:45 +02:00
.gitignore
alice.txt
analyse_message_bus.rb
analyze_sidekiq_queues.rb
assemble_ember_build.rb FIX: Build plugin JS assets when there is no prebuilt bundle (#41659) 2026-07-13 17:08:49 +02:00
backport.rb DEV: More improvements to backport automation (#40839) 2026-06-14 16:01:28 +01:00
bench.rb DEV: Remove Unicorn web server in favor of Pitchfork (#39032) 2026-04-01 15:04:59 +02:00
biggest_objects.rb DEV: Enable Style/RedundantBegin rubocop rule (#40096) 2026-05-19 18:44:54 +02:00
boot_mem.rb DEV: Enable Style/RedundantBegin rubocop rule (#40096) 2026-05-19 18:44:54 +02:00
cache_critical_dns DEV: Enable Style/RedundantBegin rubocop rule (#40096) 2026-05-19 18:44:54 +02:00
check_forking.rb
check_reproducible_assets.rb DEV: Prepare for rename of app/assets/javascripts/ -> frontend/ 2025-10-22 16:24:11 +01:00
copyright-deposit
create_upcoming_change_status_prs DEV: Automatic upcoming change status report and PR creation (#40291) 2026-06-11 15:19:15 +10:00
db_timestamps_mover.rb DEV: Ensure db_timestamps_mover only touches non-null columns (#40851) 2026-06-14 14:53:07 +01:00
diff_heaps.rb
discourse DEV: Enable Style/RedundantBegin rubocop rule (#40096) 2026-05-19 18:44:54 +02:00
docker_test.rb
generate_upcoming_change_status_report DEV: Fix UC status report when reverted files encountered (#41821) 2026-07-20 16:37:35 +10:00
i18n_lint.rb UX: Link to required settings from language switcher validation error (#38374) 2026-07-16 15:51:06 -04:00
install_minio_binaries.rb
list_bundled_plugins
local_minio_s3.rb DEV: Enable Style/RedundantBegin rubocop rule (#40096) 2026-05-19 18:44:54 +02:00
memory-analysis DEV: Enable Style/RedundantBegin rubocop rule (#40096) 2026-05-19 18:44:54 +02:00
memstats.rb DEV: Enable Style/RedundantSelf rubocop rule (#40098) 2026-05-19 19:27:45 +02:00
micro_bench.rb
mwrap_sidekiq DEV: Enable Style/RedundantBegin rubocop rule (#40096) 2026-05-19 18:44:54 +02:00
profile_db_generator.rb DEV: Enable Style/RedundantBegin rubocop rule (#40096) 2026-05-19 18:44:54 +02:00
promote_migrations DEV: Promote old post-deploy migrations to pre-deploy (#38595) 2026-03-13 19:09:30 +00:00
publish_built_assets.rb DEV: Remove (again) the old non-rollup plugin compiler (#39419) 2026-04-21 21:07:46 +02:00
rails
redis_memory.rb
require_profiler.rb DEV: Enable Style/RedundantBegin rubocop rule (#40096) 2026-05-19 18:44:54 +02:00
run-licensee DEV: Update licensee config & execution (#40454) 2026-06-03 15:48:08 +01:00
silence_successful_output
spawn_backup_restore.rb DEV: Rename Backuper to Creator 2026-01-22 18:46:02 +00:00
start_test_db.rb DEV: Improve db_structure tasks (#40067) 2026-05-15 11:40:07 +01:00
switch_container_ruby
test_email_settings.rb
test_mem.rb DEV: Enable Style/RedundantBegin rubocop rule (#40096) 2026-05-19 18:44:54 +02:00
test_memory_leak.rb DEV: Enable Style/RedundantParentheses rubocop rule (#40095) 2026-05-19 15:48:09 +02:00
test_pretty_text.rb
thread_detective.rb DEV: Enable Style/RedundantSelf rubocop rule (#40098) 2026-05-19 19:27:45 +02:00
upcoming_changes_status_report DEV: Automatic upcoming change status report and PR creation (#40291) 2026-06-11 15:19:15 +10:00
user_simulator.rb DEV: Clean up requires (#34946) 2025-09-24 12:00:22 +02:00