62 Commits

Author SHA1 Message Date
Oliver Günther 61266cd96b Validate use of existing managed repository paths
https://community.openproject.org/work_packages/74165
2026-04-21 10:59:52 +02:00
Klaus Zanders ec8f5f1265 Prevent escaping the checkout root path for repositories 2026-03-13 13:19:10 +01:00
Jan Sandbrink 82fc4fcb13 Fix remaining unit test failures due to frozen string literals
This should fix the last known unit test failures occuring due to the usage of
frozen string literal comments. Those were tested in a separate
commit. Broadly enabling frozen string literals will happen in multiple
separate commits after this one and only after feature tests have been fixed
as well.
2025-04-04 17:09:48 +02:00
Ivan Kuchin 4911b8a149 remove years from copyrights (except for COPYRIGHT file) 2024-07-31 15:02:49 +02:00
ulferts 3b2121f733 Revert "Merge remote-tracking branch 'origin/release/13.4' into dev"
This reverts commit 40b2bbeb09, reversing
changes made to b4c6cb17cc.
2024-03-21 11:31:17 +01:00
Ivan Kuchin 7787e457a3 Revert "Merge branch 'dev' into release/13.4"
This reverts commit a901541269, reversing
changes made to e573ca00b7.
2024-03-20 20:19:08 +01:00
Ivan Kuchin 9e4934cd0a change quotes using rubocop --only Style/StringLiterals,Style/QuotedSymbols -a 2024-03-20 18:05:22 +01:00
Christophe Bliard c795874f7f Update copyright year for 2024
command used: `rg -l 'Copyright \(C\) 2012-202\d the OpenProject' | xargs -n 100 sed -i -r 's/Copyright \(C\) 2012-202. the OpenProject/Copyright (C) 2012-2024 the OpenProject/'`
2024-01-02 16:23:54 +01:00
Christophe Bliard 4c2a9d0aa8 Enable RSpec zero monkey patching mode
The plan for RSpec 4.0 is to disable monkey patching.

See https://github.com/rspec/rspec-core/blob/main/features/configuration/zero_monkey_patching_mode.feature for details.
2023-05-31 19:22:29 +02:00
Christophe Bliard 9e865b4f7b lint: Run rubocop safe autocorrect
Command is `rubocop --safe --autocorrect app lib lib_static modules spec`
2023-03-09 10:25:57 +01:00
Christophe Bliard aa23106c11 lint: autocorrect RSpec/FactoryBot/ConsistentParenthesesStyle
command is

    rubocop -A --only RSpec/FactoryBot/ConsistentParenthesesStyle modules spec
2023-03-07 15:04:32 +01:00
Christophe Bliard 09c76f987c refactor: Reduce code duplication
`Activities::DaysComponent` factorizes the code to generate the HTML for
the activities per days.

By moving `journal` into `Activities::Event`, `journals_by_id` does not
need to be passed around anymore. Eager loading of journals is moved to
`Activities::Fetcher` instead of being handled by the controller. It
also means that the atom feed will be slower as it does not need the
journals information.
2023-02-16 16:34:07 +01:00
Christophe Bliard 85b3258a29 Autocorrect with some rubocop cops
RSpec/Rails/InferredSpecType and Style/RedundantConstantBase

rubocop --autocorrect-all --only RSpec/Rails/InferredSpecType,Style/RedundantConstantBase spec modules/*/spec
2023-01-13 14:28:59 +01:00
Christophe Bliard 21a696ef9b Update copyright information for 2023 2022-12-30 15:51:26 +01:00
Oliver Günther 11b45715f8 Use times for the find_events method 2022-09-01 21:43:28 +02:00
Christophe Bliard 48a4f1b6ad lint with rubocop --autocorrect (safe cops only) 2022-06-02 10:40:10 +02:00
ulferts 0b5575aa64 harmonize settings & configuration
They are for now still available as separate entities but that is more due to existing references to them both. Under the hood, they now depend on the
same structure `Settings::Definition` which just as well could have been named `Configuration::Definition`, that defines:
* the name
* the default value
* the type (which might be deferred from the default value)
* the array of allowed values

Both Setting and Configuration can now be overwritten using the same mechanisms:
* Default value
* Database value
* configuration.yml (settings.yml is removed)
* ENV vars
2022-03-14 13:37:22 +01:00
Christophe Bliard bc8d423ec2 update copyright information for 2022 2022-03-01 17:05:59 +01:00
Christophe Bliard 47a297daae Fix argument alignment since f08bea3467 (#10129)
* Fix argument alignment since f08bea3467

The FactoryBot.* prefix has been removed in f08bea3467. Since then
rubocop complains about Layout/ArgumentAlignment. This commit fixes it.

* do not fix alignments for modules/*/spec yet

hoping to be under the limit of 65535 characters for reviewdog to report on rubocop errors
2022-02-02 21:48:06 +01:00
Oliver Günther f08bea3467 Remove FactoryBot.* prefix where applicable 2022-01-25 08:19:06 +01:00
Oliver Günther ccfa29c728 Move license and copyright docs to root, fix names and references 2021-09-02 21:50:46 +02:00
ulferts 1bdd2ab9ae safe automatic fixes by rubocop (#8994) 2021-02-11 16:02:18 +01:00
ulferts 6140f4c7e9 update copyright to 2021 (#8925)
Updates the copyright to 2021 for all files that have a copyright. Files in our source code without the copyright header still do not receive one automatically. Additionally, backlisted files are also excluded.

Previously the copyright of chiliproject which references redmine stated a copyright of redmine up to and including 2017 which is not true for the code we have in here. Because of that I changed that to 2013
2021-01-13 17:47:45 +01:00
ulferts 64d0f57d85 Feature/aggregated activities (#8221)
* use cte for aggregated journal

* Revert "use cte for aggregated journal"

This reverts commit 5fedefefdd.

* add another subselect that could later on be provided from the outside

* allow passing a nukleous sql to aggregated journals

* wip - using aggregated journal for activity

* new sql for aggregated journals

* start implementing new aggregated query

* additional documentation

* consolidate activity functionality

* simplify by turing into instance methods

* move activity fetcher out of redmine

* remove verb verification made obsolete

Without catchall routes, the dispatching handles it

* remove duplicate authorize check

* refactor activities controller

* refactory activity fetcher

* cache avatar file

* sort choosable events

* remove legacy spec covered by contemporary

* speed up aggregated journals via CTE

* instance var might never have been set

* ensure the event_types are always transmitted

* correctly reset the avatar cache

* fix avatar fetcher expectation regarding wiki pages

* adapt spec

[ci skip]
2020-04-27 08:04:28 +02:00
Henriette Dinger bd7f4e4814 Update copyright notice 2020-01-15 11:31:26 +01:00
Oliver Günther 1dfa9c1cf2 [30594] Implement separate version table for journals
This ensures inserts to the journal versions are atomtic, so we can
avoid locking the journals table.

https://community.openproject.com/wp/30594
2019-07-26 15:26:31 +02:00
Jens Ulferts 9e48a53841 move spec from legacy 2019-02-05 09:28:07 +01:00
Oliver Günther f86abae9eb Enforce Arel.sql for string order, pluck 2018-12-03 10:31:57 +01:00
Oliver Günther 059770f533 FactoryGirl => FactoryBot
Removes the deprecation
2018-05-07 22:38:20 +02:00
Oliver Günther 6ef4211e77 Bump copyright to 2018 (#6171)
[ci skip]
2018-02-12 08:51:12 +01:00
Oliver Günther aeb0dc8def Allow range for git_spec on mac
[ci skip]
2017-09-06 13:40:41 +02:00
Oliver Günther c5b8add0e7 Restrict local cloning feature to http(s) and file urls (#5850)
[ci skip]
2017-08-15 10:47:21 +02:00
Markus Kahl 1061abf818 specs 2017-05-05 13:43:04 +01:00
Markus Kahl c7cec30020 allow truncating repo browser list - Setting.repository_truncate_at 2017-05-04 14:38:44 +01:00
Oliver Günther 7cf11bb689 Update copyright notice 2017-01-10 15:11:43 +01:00
Jens Ulferts 6fcb2913d4 cast to array before slicing 2016-09-08 11:42:02 +02:00
Oliver Günther 3848c8aef0 Merge branch 'release/5.0' into dev 2016-04-26 07:45:35 +02:00
Oliver Günther 638340e7b6 Fix rubocop issues 2016-04-22 11:07:51 +02:00
Oliver Günther e9cd24f2bf Add support for parent-scoped with_settings data 2016-04-22 10:19:20 +02:00
Oliver Günther 8fd75e0456 Extend Subversion repository with UTF-8 paths (#4326)
Provide some test data for UTF-8 encoded paths with Subversion.
This confirms the tests of PR #4324.

Side note:
OS X will decompose some unicode characters into two characters.
For example, the LATIN SMALL LETTER O WITH DIAERESIS (U+00F6 `ö`) will be
decomposed into o and COMBINING DIAERESIS (U+0308).

This obviously breaks SVN path mapping and while you will be able to
commit files with decomposed paths, it will wreak havoc when using these
characters on repositories manipulated by OSX and other systems.
It apepars that Windows, Linux silently ignore these changes.

We can't really account for this server side, but unicode-path patches exists for Subversion on OSX.
For git, a config setting exists that does just that (`core.precomposeunicode`).
2016-04-18 11:12:19 +02:00
Oliver Günther 02b5b8dda1 Add simple YAML extraction of ENV overrides
Allows users to pass arrays or hashes via `[foo,bar]` and `{ foo: bar }`
notation via inline YAML syntax.
2016-02-23 15:04:00 +01:00
Oliver Günther 04398738f2 Allow Repository.disabled_types to be strings
When passing configuration settings through ENV (e.g., packager), we
can't pass arrays as configuration settings.

This PR allows `Repository.disabled_types` to be set as a String in ENV,
e.g., through
`OPENPROJECT_SCM_SUBVERSION_DISABLED__TYPES='existing,foobar'`.
2016-02-16 13:45:22 +01:00
Oliver Günther 589ba8e7b1 Relocate repositories locally and remote
This commit introduces relocating a repository as a followup after
a project's identifier has been renamed.
2015-10-28 13:45:30 +01:00
Oliver Günther c13afd01c4 Force disabled_types to be symbols
To avoid exposed types from misconfiguration (or installations where
string-based configuration is a requirement), we convert the input from
`disabled_types` to be symbols.
2015-09-09 09:48:58 +02:00
Alex Coles a3bbe70e42 Merge branch 'dev' into feature/rails4.1
Signed-off-by: Alex Coles <alex@alexbcoles.com>
2015-08-24 21:41:56 +02:00
Oliver Günther 1219e08c1c Remove deprecated finders in repository spec 2015-08-21 15:22:05 +02:00
Oliver Günther b15002beca More explicit validation error message for repositories
Adds a specific message for repository validation from enabled SCM

Fixes missed venodor keys in specs
2015-08-20 08:45:46 +02:00
Oliver Günther a71ce6f1a5 Refactor SCM config to lowercase / symbols
ENV-based configuration for various configs can only provide
case-insensitive values for SCM configuration and thus is
unable to properly configure, e.g., managed repositories.

This refactoring relies on lowercase configuration and symbols
to define SCM vendors, and camelizes them to the old notation
(e.g., :git => 'Git') when using `Setting.enabled_scms` to remain
compatible with previous installations.
2015-08-20 08:45:46 +02:00
Alex Coles fbda936441 Update Repository specs for file_changes rename
See a8e92e25.

Signed-off-by: Alex Coles <alex@alexbcoles.com>
2015-08-19 22:43:51 +02:00
Alex Coles cdffaedbca Fix deprecation regressions in Repository specs
Signed-off-by: Alex Coles <alex@alexbcoles.com>
2015-08-17 12:11:09 +02:00