Commit Graph

1035 Commits

Author SHA1 Message Date
Matthias Thieroff
0f01bb82c6 Fix bugs in unit tests which occur on Windows only (#1927)
On Windows it is much more necessary to close files to avoid locked files which prevent deleting a temporary file or folder. Also paths need to be handled differently because of the drive letter and colon appearing on Windows.
2022-01-20 08:48:13 +01:00
Eduard Heimbuch
aa1558dbac Disable repository types (#1908)
Disable repository types via global config for Git, Mercurial and Subversion. It is only possible to disable a type, if no repositories of this type exist. Also prevent repository creation if no type is allowed at all to catch nasty errors.

Co-authored-by: Konstantin Schaper <konstantin.schaper@cloudogu.com>
2022-01-06 10:05:01 +01:00
Matthias Thieroff
5b700dc0c7 Fix closing of repository while getting the latest commit asynchronously (#1903)
Getting the latest commit can run asynchronously, which can lead to a reopening of a repository after the RepositoryService has already closed it. This lead to an open file handle which prevented a proper deletion of the repository. We now explicitly open and close the repository when getting the latest commit.
2021-12-21 15:09:41 +01:00
René Pfeuffer
1118ddd146 Ahead/behind in branch details (#1893)
Adds the ahead/behind count to the branch details view.
2021-12-15 15:03:40 +01:00
Eduard Heimbuch
b8d6c219ee Add extension point to branches overview (#1888)
Prepare branches overview to show additional branch details.

Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2021-12-10 11:04:59 +01:00
Florian Scholdei
7f807a8e0f Improve headings structure (#1883)
The content of the SCM-Manager should be made accessible and usable in a sensibly structured way so that web content is easy to use for ever user.
2021-12-02 08:45:50 +01:00
Eduard Heimbuch
9cc134f5a8 Feature/branch details (#1876)
Enrich branch overview with more details like last committer and ahead/behind commits. Since calculating this information is pretty intense, we request it in chunks to prevent very long loading times. Also we cache the results in frontend and backend.

Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2021-12-01 14:19:18 +01:00
René Pfeuffer
6ea77b42ca Fix edge cases in move (#1874)
Fixes edge cases for "move" in the modify command, like

- reject backslashes in validation
- add overwrite option
- check for invalid source and target options

This is an update to the implementation of "move" in #1859.

Co-authored-by: Matthias Thieroff <matthias.thieroff@cloudogu.com>
2021-11-30 08:49:47 +01:00
Sebastian Sdorra
9dee08f68d Update Gradle to 7.3 (#1873)
Update Gradle to 7.3. in order to profit from the performance improvement and to prepare for dependency lockfiles. Due to the upgrade to 7.x we had to use a license plugin which supports Gradle 7.
2021-11-29 09:05:24 +01:00
Konstantin Schaper
13590676fd Add move to modify command (#1859)
dds a move/rename functionality to the modify command. This currently only works for absolute destination paths and does not work with backslashes. If the destination path does not exist, it is created. The action fails if the target file already exists.
2021-11-19 08:43:44 +01:00
Sebastian Sdorra
e255eafa29 Fix git unit tests on machines which are not using master as init branch (#1854) 2021-11-10 15:45:12 +01:00
Eduard Heimbuch
6f61fefec5 Improve a11y (#1841)
Improve accessibility by removing unnecessary tags without hrefs. Also remove many eslint errors and warnings.
2021-11-04 09:16:08 +01:00
René Pfeuffer
cab09680f8 Fix initial mirror sync if empty (#1842)
Fixes an error, when the initial synchronization of a git mirror had no branches.
2021-11-03 10:51:06 +01:00
René Pfeuffer
e1a2d27256 Implement file lock for git (#1838)
Adds a "file lock" command that can be used to mark files as locked by a specific user. This command is implemented for git using a store to keep the locks.

Additionally, the Git LFS locking API is implemented.

To display locks, the scm-manager/scm-file-lock-plugin can be used.

Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
2021-11-01 16:54:58 +01:00
René Pfeuffer
27b9d2c78a Resolved branch revision in Source Extension Point (#1803)
This adds the "resolved revision" of the HEAD (of the current branch, if branches are supported) to the extension point repos.sources.extensions. This "resolved revision" holds the current HEAD revision of the repository (or the selected branch, if branches are supported). This means you can check, whether the release has changed since an extension has been rendered for the first time.

Co-authored-by: Konstantin Schaper <konstantin.schaper@cloudogu.com>
2021-10-20 13:29:47 +02:00
René Pfeuffer
6a881b3d98 Fixes recursive browse for git (#1833)
The recursive browse command failed to list files
that started with a name of a folder. These were
listed as children of the folder that has the same
name as the prefix of the file.
2021-10-20 11:28:35 +02:00
René Pfeuffer
39e367bd70 Prevent deletion of default branch (#1827)
Adds a pre receive repository hook that prevents the deletion of the default branch.
Mirrored repositories will change their default branches to another branch, when it is deleted.
2021-10-19 17:31:35 +02:00
René Pfeuffer
41b8f091c0 Add recursive deletion in modify command (#1821)
Adds a method in the ModifyCommand to delete not only files, but also directories recursively.
2021-10-07 14:40:48 +02:00
René Pfeuffer
f6de626cd5 Fix edge cases in mirror command (#1812)
- The clone of the repository failed, if no master branch had
  been mirrored, because this was what the HEAD was set to, and
  jgit fails with an exception if the HEAD branch does not exist.
- The HEAD branch had to be corrected to an existing branch,
  because otherwise a rejected 'master' branch could not be
  deleted and was synchronized in a second sync if the working
  directory had been cached.
2021-09-28 09:54:14 +02:00
Florian Scholdei
2cb006d040 Replace styled-components with bulma helpers (#1783)
Use Bulma helpers whenever possible instead of custom styled components.
This pull request replaces primarily color definitions, spacing and flex instructions.
2021-09-15 17:40:08 +02:00
Eduard Heimbuch
43e1ea06c8 Fix HalRepresentationWithEmbedded type (#1793)
Fix HalRepresentationWithEmbedded type since _embedded can be null.

Co-authored-by: Sebastian Sdorra <sebastian.sdorra@cloudogu.com>
2021-09-02 15:47:15 +02:00
Konstantin Schaper
9ad501b4c6 fix redundant git repo closing (#1789)
Both the GitLogCommand and the GitModificationsCommand incorrectly closed the underlying git repository. This caused the git repository to be opened once but closed twice, which in turn flooded the logs with avoidable warnings and affected performance. The redundant closing of the git repo has been removed from both commands.
2021-09-01 09:44:11 +02:00
Sebastian Sdorra
7f9f4e566c Proxy support for pull, push and mirror commands (#1773)
Apply proxy support for jGit by extracting the required functionality from the DefaultAdvancedHttpClient into its own class HttpURLConnectionFactory. This new class is now used by the DefaultAdvancedHttpClient and jGit.
The HttpURLConnection also fixes proxy server authentication, which was non functional in DefaultAdvancedHttpClient.
The proxy support for SVNKit is implemented by using the provided method of the BasicAuthenticationManager.
For mercurial the support is configured by writing the required settings to a temporary hgrc file.
2021-08-19 11:27:51 +02:00
Sebastian Sdorra
3e6ce4e814 Add DefaultBranchChangedEvent (#1763)
The DefaultBranchChangedEvent is fired whenever the default branch of repository changes.
2021-08-11 09:28:00 +02:00
René Pfeuffer
8558572c99 Modifications command between two revisions (#1761)
Adds the option to compute the modifications between two revisions unsing the modifications command.
2021-08-09 12:13:41 +02:00
René Pfeuffer
c3f3778295 Fire post receive hook after import (#1754)
The repository import did not post any PostReceiveRepositoryHookEvent, only an ImportRepositoryHookEvent. With this fix, both events are posted.
2021-08-03 14:31:12 +02:00
Eduard Heimbuch
d6402ad1cb Redesign repository overview (#1740)
Change repository overview layout to use single rows instead cards. Also remove quick links and add clone action to repository entry. The default repository link now leads to the sources view.

Co-authored-by: Sebastian Sdorra <sebastian.sdorra@cloudogu.com>
2021-07-28 15:04:00 +02:00
René Pfeuffer
68b2976578 Filter master branch correctly on initial mirror (#1747)
On the first synchronization, the clone has the implicit branch "master". This cannot be
changed in JGit. When we fetch the refs from the repository that should be mirrored, the
master branch of the clone will be updated to the revision of the remote repository (if
it has a master branch). If now the master branch shall be filtered from mirroring (ie.
if it is rejected), we normally would delete the ref in this clone. But because it is
the current branch, it cannot be deleted. We detect this and later, 
after we have pushed the result, delete the master branch by pushing 
an empty ref to the central repository.
2021-07-28 12:04:57 +02:00
René Pfeuffer
ad6000722d LRU semantic for workdir cache (#1735)
Introduces a maximum size for the simple workdir cache. On cache overflow workdirs are evicted using an LRU strategy.
Furthermore parallel requests for the same repository will now block until the workdir is released.
2021-07-28 07:54:37 +02:00
Eduard Heimbuch
f52c0b07bf Enhance push command with username/password authentication (#1734) 2021-07-23 13:42:39 +02:00
René Pfeuffer
b9d5c3aa8d Fix hook events for git mirror command (#1703)
Currently the mirror command implementation for git fires post receive repository hook events, that return every changeset of the repository instead of those really added by the single mirror update.

This fixes this issue by first creating a working copy, running the fetch and the update in this clone, and then pushing back the result to the central repository. This triggers the internal mechanisms used in other commands like the modify command.

The downside of this is, that we first have to create the clone, so for big mirrors a cached working copy is strongly recommended.
2021-06-16 14:26:02 +02:00
René Pfeuffer
b6d343bf09 Make auth expiration for LFS configurable (#1697)
When SCM-Manager is used behind a reverse proxy like
Nginx it may be the case, that lfs PUT requests are
buffered by the reverse proxy and will be sent to the
SCM-Manager after the whole file has been received. Due
to the expiration time of 5 minutes for the authentivation
token that had been requested by Git before the upload
has been started, this request from the proxy to
SCM-Manager fails if the upload from the client to the
reverse proxy took longer than these 5 minutes.

To solve this, we make this expiration time configurable,
so that whenever you have very large files or small
bandwidth the expiration timeout can be increased.
2021-06-16 09:14:52 +02:00
René Pfeuffer
b14fa86550 Add log for error in git mirror (#1689)
Without this log you will get no trace of the error,
only the message of it in the mirror log. This may
not be enough to trace the cause of the error.
2021-06-09 08:57:01 +02:00
Eduard Heimbuch
dd0975b49a Feature/mirror (#1683)
Add mirror command and extension points.

Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
Co-authored-by: Sebastian Sdorra <sebastian.sdorra@cloudogu.com>
Co-authored-by: Konstantin Schaper <konstantin.schaper@cloudogu.com>
2021-06-04 14:05:47 +02:00
Sebastian Sdorra
d7d0d2375c Update jgit to v5.11.1.202105131744-r-scm1 (#1661)
Update jgit to v5.11.1.202105131744-r-scm1

Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
2021-05-20 14:14:58 +02:00
Eduard Heimbuch
7e3a6b6fb2 Show correct default branch in repository config (#1643) 2021-05-05 14:45:18 +02:00
René Pfeuffer
77b62be68a Fix messages for post commit hooks in git (#1647)
Fixes the transmission of messages from post commit hooks in Git repositories. We therefore use a new method patched in jGit for SCM-Manager. This simplifies the trigger logic a lot.
2021-05-04 16:53:43 +02:00
Eduard Heimbuch
af8980de19 Improve repository information page (#1636)
Only show relevant information for repository on repository information page. The initialization code example is only shown if the repository is still empty.
2021-04-29 18:13:32 +02:00
Eduard Heimbuch
d94ebb2e3e Validate filepath and filename to prevent path traversal (#1604)
Validate filepath and filename to prevent path traversal in modification
command and provide validations for editor plugin.

Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2021-03-25 12:50:24 +01:00
Eduard Heimbuch
c5720b36b5 Collect metrics over lifetime of working copies (#1591)
Capture metrics about the lifetime of working copies used, for example, by the merge and modify commands. Working copies are internal repository clones that can place a large load on the server. Therefore, these metrics can be helpful in identifying sources of large server load.

Co-authored-by: Sebastian Sdorra <sebastian.sdorra@cloudogu.com>
2021-03-24 13:03:20 +01:00
Sebastian Sdorra
26b65582ce Core metrics (#1586)
Expose metrics for http requests and executor services.
2021-03-17 11:09:52 +01:00
René Pfeuffer
84c8e02bf1 Feature Partial Diff (#1581)
With this pull request, diffs for Git are loaded in chunks. This means, that for diffs with a lot of files only a part of them are loaded. In the UI a button will be displayed to load more. In the REST API, the number of files can be specified. This only works for diffs, that are delivered as "parsed" diffs. Currently, this is only available for Git.

Co-authored-by: Sebastian Sdorra <sebastian.sdorra@cloudogu.com>
2021-03-12 13:52:17 +01:00
Florian Scholdei
0d3339b0cb Add repository-specific non-ff disallowed option (#1579)
Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2021-03-11 10:13:26 +01:00
Eduard Heimbuch
7852d1034e Fix build warnings (#1562)
Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2021-03-01 09:08:01 +01:00
Sebastian Sdorra
888f5d699b Fire RepositoryImportHookEvent instead of PostReceiveRepositoryHookEvent (#1561)
We will fire an RepositoryImportHookEvent instead of PostReceiveRepositoryHookEvent for repository imports with metadata. The event is only fired if all parts of the repository could be successfully imported. The extra event is required to avoid heavy recalculations which can be triggered by the PostReceiveRepositoryHookEvent for example the scm-statistic-plugin uses the PostReceiveRepositoryHookEvent to calculate its statistics.

Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
2021-02-26 09:49:34 +01:00
Eduard Heimbuch
83a9c90130 Post receive hook after import (#1544)
Fire post receive repository hook event after pull from remote
and after unbundle (Git, HG and SVN)

Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
2021-02-22 09:20:15 +01:00
René Pfeuffer
eef74e3a50 Fix flappy test 2021-02-19 09:42:59 +01:00
René Pfeuffer
d0df8977ef Bugfix for long filenames in tar (#1552)
Fixes errors with long file names in tar archives. This may arise with hg repositories with deep directories.
2021-02-18 16:30:35 +01:00
René Pfeuffer
b8bd140934 Debug test failure 2021-02-16 10:18:09 +01:00
René Pfeuffer
04c6243f64 Fix interrupt handling 2021-02-04 09:23:32 +01:00