Skip to content

Commit 319164a

Browse files
Release OpenProject 16.6.6
2 parents 99112f3 + d7ccf69 commit 319164a

File tree

14 files changed

+116
-221
lines changed

14 files changed

+116
-221
lines changed

app/controllers/repositories_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ def diff
233233
end
234234

235235
filename = "changeset_r#{@rev}"
236-
filename << "_r#{@rev_to}" if @rev_to
236+
filename += "_r#{@rev_to}" if @rev_to
237237
send_data @diff.join,
238238
filename: "#{filename}.diff",
239239
type: "text/x-patch",

app/helpers/work_packages_helper.rb

Lines changed: 28 additions & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -36,116 +36,27 @@ module WorkPackagesHelper
3636
# Examples:
3737
#
3838
# link_to_work_package(package) # => Defect #6: This is the subject
39-
# link_to_work_package(package, all_link: true) # => Defect #6: This is the subject (everything within the link)
40-
# link_to_work_package(package, truncate: 9) # => Defect #6: This i...
41-
# link_to_work_package(package, subject: false) # => Defect #6
42-
# link_to_work_package(package, type: false) # => #6: This is the subject
43-
# link_to_work_package(package, project: true) # => Foo - Defect #6
44-
# link_to_work_package(package, id_only: true) # => #6
45-
# link_to_work_package(package, subject_only: true) # => This is the subject (as link)
46-
# link_to_work_package(package, status: true) # => #6 New (if #id => true)
47-
def link_to_work_package(package, options = {})
48-
if options[:subject_only]
49-
options.merge!(type: false,
50-
subject: true,
51-
id: false,
52-
all_link: true)
53-
elsif options[:id_only]
54-
options.merge!(type: false,
55-
subject: false,
56-
id: true,
57-
all_link: true)
58-
else
59-
options.reverse_merge!(type: true,
60-
subject: true,
61-
id: true)
62-
end
63-
64-
parts = { prefix: [],
65-
hidden_link: [],
66-
link: [],
67-
suffix: [],
68-
title: [],
69-
css_class: link_to_work_package_css_classes(package, options) }
70-
71-
# Prefix part
72-
73-
parts[:prefix] << package.project.to_s if options[:project]
74-
75-
# Link part
76-
77-
parts[:link] << h(options[:before_text].to_s) if options[:before_text]
78-
79-
parts[:link] << h(package.type.to_s) if options[:type]
80-
81-
parts[:link] << "##{h(package.id)}" if options[:id]
82-
83-
parts[:link] << h(package.status).to_s if options[:id] && options[:status] && package.status_id
84-
85-
# Hidden link part
86-
87-
if package.closed? && !options[:no_hidden]
88-
parts[:hidden_link] << content_tag(:span,
89-
I18n.t(:label_closed_work_packages),
90-
class: "sr-only")
39+
# link_to_work_package(package, link_subject: true) # => Defect #6: This is the subject (everything within the link)
40+
# link_to_work_package(package, display_project: true) # => Foo - Defect #6: This is the subject
41+
def link_to_work_package(work_package, display_project: false, link_subject: false) # rubocop:disable Metrics/AbcSize
42+
output = "".html_safe
43+
output << "#{work_package.project} - " if display_project && work_package.project_id
44+
45+
link = link_to(work_package_path(work_package),
46+
title: work_package.subject,
47+
class: link_to_work_package_css_classes(work_package)) do
48+
link_parts = []
49+
link_parts << work_package.type.to_s if work_package.type_id
50+
link_parts << "##{work_package.id}:"
51+
link_parts << content_tag(:span, I18n.t(:label_closed_work_packages), class: "sr-only") if work_package.closed?
52+
link_parts << work_package.subject if link_subject
53+
54+
safe_join(link_parts, " ")
9155
end
9256

93-
# Suffix part
94-
95-
if options[:subject]
96-
subject = if options[:subject]
97-
subject = package.subject
98-
if options[:truncate]
99-
subject = truncate(subject, length: options[:truncate])
100-
end
101-
102-
subject
103-
end
104-
105-
parts[:suffix] << h(subject)
106-
end
107-
108-
# title part
109-
110-
parts[:title] << (options[:title].nil? ? package.subject : options[:title])
111-
112-
# combining
113-
114-
prefix = parts[:prefix].join(" ")
115-
suffix = parts[:suffix].join(" ")
116-
link = parts[:link].join(" ").strip
117-
hidden_link = parts[:hidden_link].join
118-
title = parts[:title].join(" ")
119-
css_class = parts[:css_class].join(" ")
120-
121-
# Determine path or url
122-
work_package_link =
123-
if options.fetch(:only_path, true)
124-
work_package_path(package)
125-
else
126-
work_package_url(package)
127-
end
128-
129-
if options[:all_link]
130-
link_text = [prefix, link].reject(&:empty?).join(" - ")
131-
link_text = [link_text, suffix].reject(&:empty?).join(": ")
132-
link_text = [hidden_link, link_text].reject(&:empty?).join
133-
134-
link_to(link_text.html_safe,
135-
work_package_link,
136-
title:,
137-
class: css_class)
138-
else
139-
link_text = [hidden_link, link].reject(&:empty?).join
140-
141-
html_link = link_to(link_text.html_safe,
142-
work_package_link,
143-
title:,
144-
class: css_class)
145-
146-
[[prefix, html_link].reject(&:empty?).join(" - "),
147-
suffix].reject(&:empty?).join(": ")
148-
end.html_safe
57+
output << link
58+
output << " #{work_package.subject}" unless link_subject
59+
output
14960
end
15061

15162
def work_package_list(work_packages, &)
@@ -176,7 +87,7 @@ def work_package_formatted_dates(work_package)
17687
"#{start_date} - #{due_date}"
17788
end
17889

179-
def send_notification_option(checked = false)
90+
def send_notification_option(checked: false)
18091
content_tag(:label, for: "send_notification", class: "form--label-with-check-box") do
18192
(content_tag "span", class: "form--check-box-container" do
18293
boxes = hidden_field_tag("send_notification", "0", id: nil)
@@ -220,10 +131,10 @@ def last_work_package_note(work_package)
220131

221132
def work_packages_columns_options
222133
@work_packages_columns_options ||= Query
223-
.new
224-
.displayable_columns
225-
.sort_by(&:caption)
226-
.map { |column| { name: column.caption, id: column.name.to_s } }
134+
.new
135+
.displayable_columns
136+
.sort_by(&:caption)
137+
.map { |column| { name: column.caption, id: column.name.to_s } }
227138
end
228139

229140
def selected_work_packages_columns_options
@@ -232,13 +143,14 @@ def selected_work_packages_columns_options
232143
end
233144

234145
def protected_work_packages_columns_options
146+
protected_columns = %w[id subject]
235147
work_packages_columns_options
236-
.select { |column| column[:id] == "id" || column[:id] == "subject" }
148+
.select { |column| protected_columns.include?(column[:id]) }
237149
end
238150

239151
private
240152

241-
def truncated_work_package_description(work_package, lines = 3)
153+
def truncated_work_package_description(work_package, lines = 3) # rubocop:disable Metrics/AbcSize
242154
description_lines = work_package.description.to_s.lines.to_a[0, lines]
243155

244156
if description_lines[lines - 1] && work_package.description.to_s.lines.to_a.size > lines
@@ -261,24 +173,9 @@ def truncated_work_package_description(work_package, lines = 3)
261173
end
262174
end
263175

264-
def info_user_attributes(work_package)
265-
responsible = if work_package.responsible_id.present?
266-
"<span class='label'>#{WorkPackage.human_attribute_name(:responsible)}:</span> " +
267-
h(work_package.responsible.name).to_s
268-
end
269-
270-
assignee = if work_package.assigned_to_id.present?
271-
"<span class='label'>#{WorkPackage.human_attribute_name(:assigned_to)}:</span> " +
272-
h(work_package.assigned_to.name).to_s
273-
end
274-
275-
[responsible, assignee].compact.join("<br>").html_safe
276-
end
277-
278-
def link_to_work_package_css_classes(package, options)
176+
def link_to_work_package_css_classes(package)
279177
classes = ["work_package"]
280178
classes << "closed" if package.closed?
281-
classes << options[:class].to_s
282179

283180
classes
284181
end

app/views/versions/index.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ See COPYRIGHT and LICENSE files for more details.
6666
<div>
6767
<ul>
6868
<%- issues.each do |issue| -%>
69-
<li><%= link_to_work_package(issue, project: (@project != issue.project)) %></li>
69+
<li><%= link_to_work_package(issue, display_project: (@project != issue.project)) %></li>
7070
<%- end -%>
7171
</ul>
7272
</div>

docker/ci/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ RUN apt-get update -qq && \
1111
apt-get install -y wget gnupg lsb-release curl && \
1212
wget --quiet -O- https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor -o /usr/share/keyrings/postgrsql.gpg - && \
1313
echo "deb [signed-by=/usr/share/keyrings/postgrsql.gpg] http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list
14-
ENV CHROME_SOURCE_URL="https://dl.google.com/dl/linux/direct/google-chrome-stable_current_amd64.deb"
14+
# Temporarily use a mirror for Chrome until the official one no longer has issues with xeokit. Can be tested by running
15+
# rspec ./modules/bim/spec/features/bcf/create_spec.rb:107 after switching to the official package source.
16+
ENV CHROME_SOURCE_URL="https://mirror.cs.uchicago.edu/google-chrome/pool/main/g/google-chrome-stable/google-chrome-stable_142.0.7444.134-1_amd64.deb"
1517
RUN --mount=type=cache,target=/var/cache/apt export f="/tmp/chrome.deb" && wget --no-verbose -O $f $CHROME_SOURCE_URL && \
1618
apt-get update -qq && apt-get install -y "$f" postgresql-$PGVERSION postgresql-client-$PGVERSION time imagemagick default-jre-headless firefox-esr && \
1719
rm -f "$f" && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /var/lib/postgresql && find /usr/share/locale/* -maxdepth 0 -type d ! -name 'en' -exec rm -rf {} \;
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
title: OpenProject 16.6.6
3+
sidebar_navigation:
4+
title: 16.6.6
5+
release_version: 16.6.6
6+
release_date: 2026-01-27
7+
---
8+
9+
# OpenProject 16.6.6
10+
11+
Release date: 2026-01-27
12+
13+
We released OpenProject [OpenProject 16.6.6](https://community.openproject.org/versions/2261).
14+
The release contains security related bug fixes and we strongly urge you to update to the newest version.
15+
Below you will find a complete list of all changes and bug fixes.
16+
17+
<!--more-->
18+
19+
## Bug fixes and changes
20+
21+
<!-- Warning: Anything within the below lines will be automatically removed by the release script -->
22+
<!-- BEGIN AUTOMATED SECTION -->
23+
24+
- Bugfix: Fix revision parsing in git diff output \[[#71019](https://community.openproject.org/wp/71019)\]
25+
26+
<!-- END AUTOMATED SECTION -->
27+
<!-- Warning: Anything above this line will be automatically removed by the release script -->

docs/release-notes/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ Stay up to date and get an overview of the new features included in the releases
1313
<!--- New release notes are generated below. Do not remove comment. -->
1414
<!--- RELEASE MARKER -->
1515

16+
## 16.6.6
17+
18+
Release date: 2026-01-27
19+
20+
[Release Notes](16-6-6/)
21+
22+
1623
## 16.6.5
1724

1825
Release date: 2026-01-16

lib/open_project/journal_formatter/cause.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def related_work_package_changed_message
161161
if related_work_package
162162
I18n.t(
163163
"journals.cause_descriptions.#{cause['type']}",
164-
link: html? ? link_to_work_package(related_work_package, all_link: true) : "##{related_work_package.id}"
164+
link: html? ? link_to_work_package(related_work_package, link_subject: true) : "##{related_work_package.id}"
165165
)
166166

167167
else

lib/open_project/object_linking.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def link_to_project(project, options = {}, html_options = nil, show_icon = false
125125
link_to(project_name, project_path_or_url(project, options), html_options)
126126
else
127127
project_name
128-
end.html_safe
128+
end
129129
end
130130

131131
# Like #link_to_user, but will render a Primer link instead of a regular link.

lib/open_project/scm/adapters/git.rb

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -404,12 +404,7 @@ def build_revision_args(path, identifier_from, identifier_to, options)
404404
end
405405

406406
def diff(path, identifier_from, identifier_to = nil)
407-
args = []
408-
if identifier_to
409-
args << "diff" << "--no-abbrev-commit" << "--no-color" << identifier_to << identifier_from
410-
else
411-
args << "show" << "--no-abbrev-commit" << "--no-color" << identifier_from
412-
end
407+
args = build_diff_range(identifier_from, identifier_to)
413408
args << "--" << scm_encode(@path_encoding, "UTF-8", path) unless path.empty?
414409
capture_git(args).lines
415410
rescue Exceptions::CommandFailed
@@ -468,6 +463,20 @@ def format_identifier
468463

469464
protected
470465

466+
##
467+
# Build diff range given one or two user inputs
468+
# first resolving them to actual commits.
469+
def build_diff_range(identifier_from, identifier_to = nil)
470+
from_sha = resolve_commit(identifier_from)
471+
472+
if identifier_to
473+
to_sha = resolve_commit(identifier_to)
474+
["diff", "--no-abbrev-commit", "--no-color", to_sha, from_sha]
475+
else
476+
["show", "--no-abbrev-commit", "--no-color", from_sha]
477+
end
478+
end
479+
471480
##
472481
# Builds the full git arguments from the parameters
473482
# and return the executed stdout as a string
@@ -520,6 +529,12 @@ def build_git_cmd(args, opts = {})
520529
args.unshift("--git-dir", git_dir) unless checkout? && !opts[:no_chdir]
521530
args
522531
end
532+
533+
# Resolve any user-provided commit-ish (branch, tag, HEAD~1, etc.) to a commit SHA,
534+
# so we can be sure to work with a valid commit identifier.
535+
def resolve_commit(rev)
536+
capture_git(["rev-parse", "--verify", "--quiet", "--end-of-options", "#{rev}^{commit}"]).strip
537+
end
523538
end
524539
end
525540
end

lib/open_project/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ module OpenProject
3333
module VERSION # :nodoc:
3434
MAJOR = 16
3535
MINOR = 6
36-
PATCH = 5
36+
PATCH = 6
3737

3838
class << self
3939
# Used by semver to define the special version (if any).

0 commit comments

Comments
 (0)