2493 Commits

Author SHA1 Message Date
Tomas Hykel 008f39b7f4 Revert "[STC-356] Disallow setting journal aggregation period to >2 hours"
This reverts commit 75de0dbcd2.
2026-06-12 15:36:40 +02:00
Tomas Hykel 75de0dbcd2 [STC-356] Disallow setting journal aggregation period to >2 hours 2026-06-12 15:31:55 +02:00
Kabiru Mwenja a9994352a5 Resolve Unnecessary spacing detected. [Layout/ExtraSpacing]
Layout/ExtraSpacing: Unnecessary spacing detected.
2026-06-12 11:15:04 +03:00
Tobias Dillmann b698ef9eb6 Catch malformed filter parameters 2026-06-11 09:13:49 +02:00
Kabiru Mwenja f94d7b0bfc Resolve the changes-filter predecessor once in a journals CTE
The :only_changes filter re-seeked each journal's predecessor in every EXISTS
branch (~7 LATERAL lookups per row). A CTE now shadows the journals table,
exposing predecessor_id/predecessor_data_id once per row, and each branch reads
those columns instead. On a 703-journal work package this cuts the COUNT from
~1.13M to ~35K shared buffers.
2026-06-09 10:25:21 +03:00
Kabiru Mwenja 96d5b5805f Merge pull request #23587 from opf/code-maintenance/68063-lateral-predecessor-changes-filter
Code Maintenance/STC-462: Fix slow "only changes" activity filter on work packages with long histories
2026-06-09 09:53:32 +03:00
Kabiru Mwenja 32a8bc43cc Surface the predecessor lateral alias at each call site
The LATERAL subquery is aliased `predecessor` where it is joined rather
than inside the helper, so the relation each EXISTS clause references is
visible without reading the helper.
2026-06-09 08:36:32 +03:00
Kabiru Mwenja 879cb108c9 Seek changes-filter predecessor via LATERAL instead of a version scan
The :only_changes activity filter identified each journal's predecessor
with `version = (SELECT MAX(version) WHERE version < current)`. That
predicate cannot use the (journable_type, journable_id, version) index,
so Postgres scanned every journal of the journable and filtered by
version — turning a per-page filter into an O(history) sweep run twice
(pagy's count plus the page query). A LATERAL `ORDER BY version DESC
LIMIT 1` seeks the predecessor through that index in a single row,
preserving gap-tolerant matching on `< version`.
2026-06-08 10:18:05 +03:00
Jens Ulferts 6885ca695d Merge pull request #23580 from opf/merge-release/17.5-20260605114354
Merge release/17.5 into dev
2026-06-05 16:42:32 +02:00
Kabiru Mwenja fd22629702 Code Maintenance/STC-462: Tidy the activity-tab paginator and centralise filter modes (#23552)
https://community.openproject.org/wp/STC-462

Two readability passes over the work package activity tab, no behaviour change. The paginator's private methods are reordered to follow their call order so the file reads top-down from `#call`, and the three activity filter modes (`:all`, `:only_comments`, `:only_changes`) — until now bare symbols duplicated across the controller, paginator, journal components and the hidden form — move into a single `WorkPackages::ActivitiesTab::Filters` module so the modes have one source of truth and can't drift apart. The diff reaches beyond the paginator into the controller, several components and a form, since that's where the symbols were scattered.
2026-06-05 16:50:08 +03:00
ulferts 4f5a52edf9 Merge remote-tracking branch 'origin/dev' into merge-release/17.5-20260605114354 2026-06-05 13:44:46 +02:00
Kabiru Mwenja 2dcc7dd5d1 Remove dead paginate entry point and clarify resolved-anchor recording
The Paginator.paginate class method bypassed the instance, discarding the
resolved_anchor state the controller reads after .call; it had no callers, so
drop it and keep the single new(...).call entry point. Extract the activity
anchor side effect into record_resolved_anchor so the intent is explicit at the
call site, and pin the server contract with a request spec asserting an
unresolvable activity anchor omits the resolved-comment value.
2026-06-05 14:38:02 +03:00
Kabiru Mwenja 5fdf57df69 Defer activity-tab sequence_version to anchor resolution
The work package activity tab computed a per-journal sequence_version on
every render — a ROW_NUMBER() window function over a LATERAL join — only to
stamp the legacy data-anchor-activity-id that #activity-N deep links rely on.
Nothing mints those links anymore; copy and share links use
#comment-<journal id>, which needs no extra query.

The activity number is now resolved on demand. Only a request carrying
?anchor=activity-N runs the window function, mapping the number to a journal
id the paginator exposes as resolved_anchor. The view hands that to the
client, which rewrites #activity-N to the canonical #comment-<id> and scrolls
using the comment anchor already present in the DOM. Default renders no longer
touch the window function.

References WP #68063.
2026-06-05 14:26:04 +03:00
Kabiru Mwenja 376f5fcdc3 Code Maintenance/STC-462: Move work package activity tab from in-memory to database-level pagination (#23434) 2026-06-05 14:21:47 +03:00
Henriette Darge 6c04182dff Simplify test case 2026-06-04 09:05:50 +02:00
Behrokh Satarnejad 8801288af0 Clean stale attributes in type form configuration 2026-06-03 16:16:42 +02:00
Oliver Günther 11dc79a74d Merge remote-tracking branch 'origin/release/17.5' into dev 2026-06-02 16:22:39 +02:00
Oliver Günther 9993792dbf Merge remote-tracking branch 'origin/release/17.4' into release/17.5 2026-06-02 16:22:18 +02:00
Oliver Günther 2a6412d5ae Merge remote-tracking branch 'origin/release/17.3' into release/17.4 2026-06-02 16:22:05 +02:00
Oliver Günther bef69b6aaf Parse query params as a separate options hash, not kwargs 2026-06-02 16:21:14 +02:00
OpenProject Actions CI b2f72fd486 Merge branch 'release/17.5' into dev 2026-05-30 04:49:04 +00:00
Tomas Hykel baf9f7f2c9 fix: Stability fixes for the identifier conversion procedure 2026-05-29 13:09:26 +02:00
Tomas Hykel eb53275a85 fix: Reduce amount of locking in ConvertProjectToSemanticIdsJob 2026-05-29 12:42:40 +02:00
Jan Sandbrink 08fab3ac55 Add comment to guide developers
The exception is already intended to nudge devs towards defining a permission.
However, first time developers might not realize in which way permissions are defined,
even though they can see the location where the exception was raised.

This comment is intended to help them find their way.
2026-05-29 11:17:38 +02:00
OpenProject Actions CI 3e02e2863f Merge branch 'release/17.5' into dev 2026-05-28 12:18:34 +00:00
Tomas Hykel 7e3fbfbb65 Revert "increase to 10 chars for good measure"
This reverts commit 941230671c.
2026-05-28 13:23:51 +02:00
Tomas Hykel 941230671c increase to 10 chars for good measure 2026-05-28 13:21:05 +02:00
Tomas Hykel a8005ff6d4 just use project-{random_suffix} 2026-05-28 13:20:03 +02:00
Tomas Hykel 5343c1139d use a random suffix instead 2026-05-28 13:07:05 +02:00
Tomas Hykel ccc3a004d6 fix(db): Conversion stuck and not resumable for users after validation error during conversion job (WP #75170) 2026-05-28 12:52:24 +02:00
OpenProject Actions CI 49b802ca02 Merge branch 'release/17.5' into dev 2026-05-28 08:51:09 +00:00
Kabiru Mwenja 6e3068531f Write primary-key WP refs in auto-generated journal notes
The earlier write-time canonicalization stored the rendered
display_id ("#PROJ-7") in the journal note, which would rot under
project-identifier renames and leave dangling semantic strings if
semantic mode were rolled back. Restore the PK shape ("#42") and
let the formatter pipeline turn it into the user-facing identifier
at render time, where the resolver already handles both modes.

Both spec contexts now assert the same PK shape; the mode-specific
rendering of "#N" lives in the formatter specs.
2026-05-26 14:19:25 +03:00
Kabiru Mwenja 878048f8e8 Resolve WP labels across visibility boundaries in text macros
The macro preload was visibility-scoped — references to work packages the
recipient cannot see would fall through to the literal `#43` shape, even
when the same reference rendered as `DCP-1` for an author with full view
permission. Notification recipients saw misleading numeric ids for cross-
project references in journal notes.

Splits label resolution from link gating:

- `ResourceLinksMatcher.build_lookup` now does an unscoped fetch for the
  primary identifier and a separate visibility-scoped id pluck. The link
  handler reads `visible_to_current_user?` to decide between a navigable
  anchor and a plain-text label.
- `UpdateAncestorsService#set_journal_note` writes `#display_id` so new
  notes carry the semantic shape at the source; render-time resolution
  heals legacy `#N` content for users with view permission.

Tradeoff: a recipient without view permission now sees the WP's semantic
identifier (e.g. `DCP-1`) as plain text rather than `#43`. The reference's
existence was already disclosed by the stored journal text; the project
identifier is the only new piece of information surfaced, and is not
treated as a secret elsewhere in the system (URLs, exports, API).
2026-05-26 14:18:48 +03:00
Alexander Brandon Coles 1ba2dd2775 [#75314] Replace deprecated Pagy max_pages option
Pagy 43.4.3 deprecated `:max_pages` and recommends capping records
before pagination instead. Caps the combined array in `base_journals`.

https://community.openproject.org/wp/75314
2026-05-26 11:56:20 +02:00
Mir Bhatia 14b4228be7 Merge pull request #23283 from opf/bug/73494-role-not-created-properly-when-unselecting-all-permissions
[#73494] Role not created properly when unselecting all permissions
2026-05-21 15:36:01 +02:00
Kabiru Mwenja e597aa4216 Fix NameError: uninitialized constant Projects::Identifier::CLASSIC_IDENTIFIER_FORMAT (#23293) 2026-05-20 22:02:41 +03:00
Tomas Hykel 1ce03faa03 feat: Improve progress reporting during identifier conversion 2026-05-20 20:27:43 +02:00
Andrej 57a525cb94 Merge branch 'dev' into bug/75031-imprecise-error-for-unallowed-ip-when-testing-jira-connection 2026-05-20 15:24:24 +02:00
Andrej 82e1f72d15 Merge branch 'dev' into bug/75031-imprecise-error-for-unallowed-ip-when-testing-jira-connection 2026-05-20 12:09:01 +02:00
Mir Bhatia 9937d62cad Allow explicitly setting no permissions on role creation 2026-05-20 11:24:13 +02:00
as-op 8e8dd09c28 [#75032] Imprecise error for SSL errors when testing Jira connection
https://community.openproject.org/wp/75032
2026-05-20 11:09:36 +02:00
Dombi Attila 3b0642db88 Implement ServiceResult#bind to allow chaining successful service call operations. 2026-05-19 18:58:28 +03:00
as-op 926b726ab1 [#75031] Imprecise error for unallowed IP when testing Jira connection
https://community.openproject.org/wp/75031
2026-05-19 16:20:42 +02:00
Oliver Günther bbb925279d Debounce meeting participant additions/removals 2026-05-18 20:10:00 +02:00
Oliver Günther 33dcdb488d Allow journals to be aggregated with different times 2026-05-18 20:10:00 +02:00
Tomas Hykel 506198d55d chore: Consolidate classic project ID generation 2026-05-18 14:15:20 +02:00
Tomas Hykel e07f2006f6 remove the dot/bang conversion 2026-05-17 15:25:00 +02:00
Tomas Hykel 4e5ae54077 Fix ClassicIdentifierSuggestionGenerator to reject all-numeric slugs 2026-05-17 15:16:05 +02:00
Oliver Günther f4cc426b2c Merge pull request #23133 from opf/feat/users-filter-component
Convert custom filters on user administration to standard query
2026-05-13 14:34:04 +02:00
Tom Hykel 93e2a2bef7 Merge pull request #22938 from opf/fix/semantic_conversion_patches_4
fix: Do not trigger notifications during project identifier migration
2026-05-13 14:27:38 +02:00