プロジェクト

全般

プロフィール

Vote #73292

未完了

Rest API, add repository to project

Admin Redmine さんがほぼ4年前に追加. ほぼ4年前に更新.

ステータス:
New
優先度:
通常
担当者:
-
カテゴリ:
REST API_32
対象バージョン:
-
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
32
version_id:
0
issue_org_id:
13070
author_id:
71693
assigned_to_id:
0
comments:
5
status_id:
1
tracker_id:
2
plus1:
4
affected_version:
closed_on:
affected_version_id:
ステータス-->[New]

説明

I use init script that initialize my new project. It create project in redmine with help Rest API. I use gitolite-redmine plugin(https://github.com/ivyl/redmine-gitolite) that create git repository, if created it in redmine.
If I can create repository in redmine with RestAPI i can finished my script for automatization create new project. I am find topic http://www.redmine.org/boards/1/topics/29489 and i see, that feature needed not only for me.


journals

+1 for this feature.
either new REST API or command line for repository are OK.

in our case, we'd like to create the project and then create the git repo (with redmine_gitolite plugin) as well automatically.

for now, the only workaround is to simulate the HTTP Post as below:
<pre>
Form Data
authenticity_token:gNNDQEVaImyJUEjr6LqdbtFzPZBJjbNy+U44DhW6JzY=
repository_scm:Git
repository[is_default]:0
repository[is_default]:1
repository[identifier]:test
commit:Create
</pre>

please also refer to the related feature requests:
#10417 Add repository to project
#11977 REST API for repositories
#11203 Rest API for Repository

--------------------------------------------------------------------------------
+1

For Repo creation currently, I also use the POST directly, but would like to see an API for it.
--------------------------------------------------------------------------------
+1

Isn’t the @authenticity_token@ generated and stored in each session? Providing a token which you got from the source code of a form of a page would only work until the session expires. Is this true?

Is there a more reliable workaround for adding a repository to a project? I also don’t mind if it’s a CLI or API solution.
--------------------------------------------------------------------------------
+1
And also adding an option like @/projects/{id}.xml?include=repositories@, which would subsequently include the repository info for the requested project.

btw, I currently use a ruby script to accomplish this:
<pre><code class="ruby">
repos = Repository::Mercurial.new;
repos.url = 'file://blablabla';
repos.project = Project.find_by_identifier('{id}');
repos.save;
</code></pre>... which is generated at run-time and execute using rails' runner.
However, this is quite slow and slightly icky.
--------------------------------------------------------------------------------
I'm also trying to simulate it as an HTTP form post in the mean time, but keep getting an error "Can't verify CSRF token authenticity".
--------------------------------------------------------------------------------


related_issues

relates,New,10417,Add repository to project
relates,New,11977,REST API for repositories
relates,New,11203,Rest API for Repository

Admin Redmine さんがほぼ4年前に更新

  • カテゴリREST API_32 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0