Skip to content

Commit ed212e3

Browse files
committed
deprecate debian 10
1 parent 8803109 commit ed212e3

File tree

10 files changed

+34
-8
lines changed

10 files changed

+34
-8
lines changed

app/controllers/pages_controller.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,8 @@ class PagesController < ::ApplicationController
88
breadcrumb.add(page.to_s.humanize)
99
end
1010
end
11+
12+
def deprecated_distro
13+
@distro = ::Distro[params.fetch(:id)]
14+
end
1115
end

app/controllers/tasks_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def show
2222
breadcrumb.add("Task #{@task.id}")
2323
end
2424

25-
def create # rubocop: disable Metrics/AbcSize
25+
def create # rubocop: disable Metrics/AbcSize, Metrics/MethodLength
2626
task = ::Task::Starter.new(project, skip_fetch: params[:skip_fetch] == 'true', distro_ids: params[:distro_ids].presence).call
2727
if task.nil?
2828
redirect_back(fallback_location: tasks_path, alert: 'Pending task already exists, skipping')

app/models/distro.rb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def all
1111
end
1212

1313
def all_active
14-
@all_active ||= all.reject(&:deprecated?)
14+
@all_active ||= all.reject(&:deprecated?) # rubocop: disable ThreadSafety/ClassInstanceVariable
1515
end
1616

1717
def by_id(id)
@@ -31,6 +31,10 @@ def ids
3131
map(&:id)
3232
end
3333

34+
def active_ids
35+
all_active.map(&:id)
36+
end
37+
3438
def arches
3539
map(&:arch).uniq
3640
end
@@ -49,7 +53,7 @@ def initialize(config)
4953
freeze
5054
end
5155

52-
%w[id name image package_type setup setup_repo install_steps arch image_info_url].each do |attr|
56+
%w[id name image package_type setup setup_repo install_steps arch image_info_url deprecated].each do |attr|
5357
define_method(attr) { config.fetch(attr) }
5458
end
5559

@@ -70,7 +74,7 @@ def slug
7074
end
7175

7276
def deprecated?
73-
config['deprecated'] == true
77+
config['deprecated'].present?
7478
end
7579

7680
private

app/models/task/starter.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
class Task
22
class Starter
33
def initialize(project, skip_fetch: false, distro_ids: nil)
4-
@distro_ids = distro_ids || project.distro_ids.presence || ::Distro.ids
4+
@distro_ids = distro_ids || project.distro_ids.presence || ::Distro.active_ids
5+
@distro_ids &= ::Distro.active_ids
56
@project = project
67
@skip_fetch = skip_fetch
78
end
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<h5>Deprecated <%= @distro.name %></h5>
2+
3+
<div class="container pt-3">
4+
<p>
5+
<%= @distro.deprecated.html_safe %>
6+
</p>
7+
</div>

app/views/projects/_repos.html.erb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<h6 class="card-title">
1717
<%= link_to repo.distro.name, repository_path(repo), class: 'card-link' %>
1818
</h6>
19+
<%= render partial: 'repositories/depricated_note', locals: { distro: repo.distro } %>
1920

2021
<div class="card-text text-body-secondary fw-light">
2122
<%= render partial: 'repositories/publishing_status', locals: { repository: repo } %>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<%# locals: (distro:) -%>
2+
3+
<% if distro.deprecated? %>
4+
<span class="text-warning">Deprecated
5+
<%= link_to deprecated_distro_path_path(distro.id) do %>
6+
<i class="bi bi-question-circle-fill"></i>
7+
<% end %>
8+
</span>
9+
<% end %>

app/views/repositories/index.html.erb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616
<div class="card">
1717
<div class="card-body">
1818
<h6 class="card-title"><%= d.name %> <small class="text-secondary"><%= d.arch %></small></h6>
19-
<% if d.deprecated? %>
20-
<span class="text-warning">Deprecated <a href="#<%= d.id %>"><i class="bi bi-question-circle-fill"></i></a></span>
21-
<% end %>
19+
<%= render partial: 'depricated_note', locals: { distro: d } %>
2220

2321
<ul class="list-group list-group-flush">
2422
<% repos_for_distro.sort_by { |repo| repo.created_at }.each do |repo| %>

config/distros.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ distros:
118118
<<: *debian
119119
arch: x86_64
120120
image_info_url: 'https://hub.docker.com/_/debian'
121+
deprecated: 'Official support ended in <a href="https://endoflife.date/debian" target="_blank">September 2020</a>. Repositories stopped working in July 2025'
121122

122123
- id: 'debian_11'
123124
name: 'Debian 11'

config/routes.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,5 @@
7979
::PagesController::ALL.each do |page|
8080
get page, to: "pages##{page}", as: "pages_#{page}"
8181
end
82+
get 'distros/deprecated/:id', to: 'pages#deprecated_distro', as: :deprecated_distro_path
8283
end

0 commit comments

Comments
 (0)