48 Commits

Author SHA1 Message Date
Alexander Brandon Coles 5e9f3827f5 Freeze string literals in app/services
rubocop -A --only Style/FrozenStringLiteralComment,Layout/EmptyLineAfterMagicComment,Style/RedundantFreeze app/services
2025-07-18 17:45:24 +01: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
Klaus Zanders 9ecf3a1b49 More remaining permission check removals 2023-10-31 15:03:00 +01:00
Christophe Bliard 21a696ef9b Update copyright information for 2023 2022-12-30 15:51:26 +01:00
Christophe Bliard a33524ef6d remove ruby magic comment for utf-8
ruby interprets source encoding as utf-8 since 2.0.0, making magic comment redundant and useless
2022-03-10 19:36:58 +01:00
Christophe Bliard bc8d423ec2 update copyright information for 2022 2022-03-01 17:05:59 +01:00
ulferts 2097d02058 replace removed URI.escape method 2021-12-07 20:35:23 +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
luz paz 3683042c9b Fix typos in user facing and non-user facing code
Found via `codespell v2.1.dev0`
2021-01-24 15:08:21 +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 9e2287bfcc rename and inflect according to zeitwerk 2020-02-21 20:47:24 +01:00
Henriette Dinger bd7f4e4814 Update copyright notice 2020-01-15 11:31:26 +01:00
Oliver Günther 7a09d8fcdd delay all jobs 2019-10-30 15:15:31 +01:00
Oliver Günther a7ed2e9da0 Rewrite jobs to use ActiveJob syntax 2019-10-25 09:09:45 +02:00
Oliver Günther 6ef4211e77 Bump copyright to 2018 (#6171)
[ci skip]
2018-02-12 08:51:12 +01:00
Oliver Günther 7cf11bb689 Update copyright notice 2017-01-10 15:11:43 +01:00
Oliver Günther 1360639341 Fix URI escaping of svn checkout paths
The paths weren't properly escaped for URLs. This fix allows any
subdirectory of arbitrary chars to be displayed as a checkout URL.

This also fixes an escaping issue in the adapter that prohibits checking
folder with special characters which SVN doesn't care about.
2016-03-23 16:56:33 +01:00
Oliver Günther 396dcdd859 Add path-based checkout for SVN 2016-03-07 15:36:44 +01:00
Oliver Günther 4349f48b49 Show warning only when supported, but not enabled 2015-11-19 08:43:35 +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 abf3f49b51 Refactor services to classes 2015-10-23 07:22:44 +02:00
Oliver Günther 58ced887a2 Repository Apache module
Provides a simple mod-perl based Apache wrapper around
remote repositories.

As its functionality is very limited, it is probably not of much use outside of the packager context.
2015-10-14 09:37:31 +02:00
Oliver Günther b7465b08a6 Remote managed repositories
This commit starts the work to provide functionality with remote service hooks for managing repositories.

The main driver behind this is packager, for which we want apache to be the sole owner of the repositories it delivers, and OpenProject only as a reader, however it benefits other installations as well.
2015-10-13 12:47:15 +02:00
Oliver Günther 319c728b1a Core notifications to alleviate third-party plugins
This commit provides some helpers to alleviate SCM vendor plugins:

 * Provide code notifications when project, members and users are changed.
 * Allow Repository:* to determine base URL themselves
   (when no common URL is available)
 * Open Git adapter for subclassing (Gitolite)
2015-10-07 10:50:30 +02:00
Oliver Günther 1481afb666 Corrections from review 2015-09-02 15:04:10 +02:00
Oliver Günther 6661f2b6d5 Refuse to delete a repository in OpenProject on FS permission errors
This commit changes the behavior of removing repositories.
It is no longer possible to remove a managed repository (model) when the
underlying repository directory could not be removed.

This error originally occurred when Apache committed changes to the repository
through mod_svn, which resulted in the OpenProject user being unable to
delete a particular subdirectory.
2015-08-28 12:01:47 +02:00
Jan Sandbrink 8c8237bf09 Merge pull request #3403 from oliverguenther/fix/delete_managed_repo_permission
Fix/delete managed repo permission
2015-08-25 16:00:12 +02:00
Oliver Günther 7e7386f3b6 Rework instruction display
- Defaults to localized instruction when none is provided in the
settings
- Make readonly input visually clickable, not disabled
- Renamed `permission?` to `permissions?`
2015-08-24 18:12:55 +02:00
Oliver Günther c9d3dabab2 Delete repository: Fix internal error on lacking permissions
While rolling out on dev, we found that apache by default modifies
the access permissions of a repository.
This in turn causes the deletion of a repository to no longer complete
sucessfully, but return with a permission error.

This error was not caught an escalated into a 500 on the repository
settings.
2015-08-23 10:30:25 +02:00
Oliver Günther ef322e89dd Cleanup 2015-08-21 13:09:48 +02:00
Oliver Günther dfb8ac4853 Add basic checkout instructions
This commit adds very basic checkout instructions similar
to `openproject-checkout` to repositories.

Issues:

* Uses table style for checkout component, as exact styling is unclear
  * Adds compressed table style with less padding

* Checkout settings are best organized in a Hash with keys per SCM
* vendor. Using default settings, a lot of new setting values would be
  introduced
  * Checks for Hash in SettingsController
  * Currently can't use SettingsHelper, as it requires single setting
    values
2015-08-21 13:09:48 +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
Oliver Günther 1b9ba9c4bf Remove repository project hierarchy
This commit removes the project hierarchy introduced with
repository management.
They are not required, incompatible with mod_dav_svn and provide
little to none advantage to storing all repositories in a flat
structure for the scale we require.
2015-08-06 18:01:37 +02:00
Oliver Günther edf713fbd5 Rework managed repositories error handling
This commit:

- adds error messages for filesystem errors
- Forces services and views to use repository.root_url instead of
  managed_path, which may not be available when config is missing
2015-07-23 16:19:43 +02:00
Oliver Günther ca04363e6d Allow to delete filesystem managed repositories even when config missing
Previously, repositories could not be deleted on disk when the
`manages:` configuration entry was removed in the meantime.

This commit allows repositories to be deleted in that case because we
no longer depend on accessing the managed_root (path for `manages:`).
2015-07-23 14:14:41 +02:00
Oliver Günther bb2a09490b Remove delayed running of management workers.
This commit (temporarily) removes the delayed creation and deletion of
managed repositories for the sake of improvded error handling.
After consultation with @ulferts, we suggest to improve the `Delayed::Job`
pipeline to create means for identifying jobs (referenced ID) and to
create a unified service to manage database AND filesystem access in a
transactional manner.

Also provides the following corrections:

- Improve migration speed
- Delete parent projects only by their identifier, not the managed root
2015-07-23 14:13:34 +02:00
Oliver Günther e1bdb41bcd More complete specs wrt. coverage, cleanup 2015-07-22 14:40:16 +02:00
Oliver Günther b0c0d0a53f Avoid fishy factory delegation. 2015-07-22 14:40:15 +02:00
Oliver Günther da27a552a1 Frontend extensions and build refactoring
- switched to toggleable-attribute-groups to provide means for
adding buttons in the attribute header (e.g., delete button).

- added separate destroy_info page with different notifications
for managed and linked repositories to ensure ramifications of removing
physical repositories are communicated to the user.

- Fixed several issues regarding scm_type selection and the building
  of repositories.

Open questions still concern the question of acessing unsupported
repositories (e.g., the soon-to-be-removed filesystem adapter).
Acessing the class should will then throw an error, but we still have
to allow users to remove the affected repository (somehow).
2015-07-22 14:40:15 +02:00
Oliver Günther 2b39d8fbdf Cleaning up, Rubocop 2015-07-22 14:40:15 +02:00
Oliver Günther abc597a6d2 First draft implementation of radio-based frontend. 2015-07-22 14:40:14 +02:00
Oliver Günther 05b27c1b98 Asynchronous creation, deletion of repositories from OP.
This PR begins the push towards management of repository lifetime
from within OpenProject.

What this currently provides is the following:

  - A mixin `ManageableRepository`, included by `Repository::{Git,
      Subversion}` to provide an interface to repo management
  - Two services and delayed_job workers for creating (`CreateManagedRepositoryService`) and
  deleting (`DeleteRepositoryService`)
  - Customized rendering of subforms in the repository settings for
  arbitrary SCM vendors.

TODOS:
  - [x] Provide sane ground to work on ( cf. PR #3149 )
  - [x] Rework SCM settings form (`{scm}_tags` is currently HTML generated
        from within a Helper.)
  - [x] Ease integration of arbitrary SCM vendors
  - [x] Display meaningful error / warning when user looks at bare
  repository (currently outputs 500, as Git HEAD / svn revision is not
          available)
  - [x] I18n
  - [ ] Specs (in progress)
    - [x] Fix legacy specs
  - [ ] Decide what to do with `Filesystem` adapter.

Open Questions:

  - **Configuration**: Currently replaces the existing options in
  `configuration.yml`.
  - **Implementation specifics**:
    - Sub-projects repositories reside in a hierarchy below their parents
    - How should the delayed_job react upon failure? (esp. creation of
            repositories)

Relevant work package: https://community.openproject.org/work_packages/20416
Merge dependent on PR #3149
2015-07-22 14:40:14 +02:00
Oliver Günther 7ebac37c14 Repository Management - Refactoring and Preparation
Related work package: [#20415](https://community.openproject.org/work_packages/20415).

This is a combined refactoring and extraction effort of local SCM functionality for SVM, Git adapters in preparation for the explicit lifetime management of repositories in #20416 and implementation of (local) repository storage quota in #18393.

This PR is still heavily WIP and for the time being, depends on the **legacy specs** for testing.
To run the tests, execute the following steps:

~~~
rake test:scm:setup:all
rake spec:legacy
~~~

I'm open for ideas on how we integrate scm adapters tests into current specs.

---

- [x] Exchange `IO::Open` for `Open3` to avoid countless manual exitcode checks
- [x] Extract local functionality in its own Module
  - [] Extend `LocalClient` module with links to create/delete services for #20415
- [x] Break down unbearable local parse routines (Hound will be over the place until fixed - but down from 260 to < 20)
  - [x] `entries`
  - [x] `revisions`
- [] local repository factory
- [] Specs
  - [] Fix / Modernize
  - [] More adapter-related specs
2015-07-22 14:40:14 +02:00