-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from nlamirault/develop
Release 0.4.0
- Loading branch information
Showing
27 changed files
with
667 additions
and
225 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,4 +32,4 @@ env: | |
- EMACS=emacs24 | ||
- EMACS=emacs-snapshot | ||
script: | ||
- make ci | ||
- make test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,34 @@ | ||
# emacs-gitlab ChangeLog | ||
|
||
# Version 0.2.0 (12/22/2014) | ||
## Version 0.4 (05/29/2015) | ||
|
||
- Initial support for Users API (Thanks [marcinant][]) | ||
- ``FIX`` unit tests on Issues API | ||
- Support Notes API (Thanks [marcinant][]) | ||
- Support Milestone API (Thanks [marcinant][]) | ||
|
||
## Version 0.3 (04/19/2015) | ||
|
||
- ``#8``: Invalid URL for issue project | ||
- Refactoring unit tests (use [ert-runner][] and [overseer][]) | ||
- ``#7``: Fixed multiline descriptions breaking tabulated view (Thanks [marcinant][]) | ||
- ``#4``: FIX Documentation (Thanks [marcinant][]) | ||
- ``#2``: Wrong package name (Thanks [marcinant][]) | ||
|
||
## Version 0.2.0 (12/22/2014) | ||
|
||
- Add issues mode | ||
- Init major mode to display project issues | ||
|
||
# Version 0.1.0 (11/06/2014) | ||
## Version 0.1.0 (11/06/2014) | ||
|
||
- Helm interface to show issues | ||
- Helm interface to show projects | ||
- Launch unit test to check library version | ||
- Init project | ||
|
||
|
||
[ert-runner]: https://github.com/rejeep/ert-runner.el | ||
[overseer]: https://github.com/tonini/overseer.el | ||
|
||
[marcinant]: https://github.com/marcinant |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Copyright (C) 2014 Nicolas Lamirault <[email protected]> | ||
# Copyright (C) 2014, 2015 Nicolas Lamirault <[email protected]> | ||
|
||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
|
@@ -58,11 +58,9 @@ elpa: | |
.PHONY: build | ||
build : elpa $(OBJECTS) | ||
|
||
test: build | ||
test: clean build | ||
@echo -e "$(OK_COLOR)[$(APP)] Unit tests$(NO_COLOR)" | ||
$(CASK) exec $(EMACS) --no-site-file --no-site-lisp --batch \ | ||
$(EMACSFLAGS) \ | ||
-l test/run-tests | ||
@$(CASK) exec ert-runner | ||
|
||
.PHONY: clean | ||
clean : | ||
|
@@ -73,24 +71,17 @@ reset : clean | |
@rm -rf .cask | ||
|
||
pkg-file: | ||
$(CASK) pkg-file | ||
@$(CASK) pkg-file | ||
|
||
pkg-el: pkg-file | ||
$(CASK) package | ||
@$(CASK) package | ||
|
||
package: clean pkg-el | ||
@echo -e "$(OK_COLOR)[$(APP)] Packaging$(NO_COLOR)" | ||
cp dist/$(ARCHIVE) . | ||
gzip $(ARCHIVE) | ||
rm -fr dist | ||
|
||
.PHONY: ci | ||
ci : elpa | ||
@echo -e "$(OK_COLOR)[$(APP)] Unit tests with code coverage$(NO_COLOR)" | ||
$(CASK) exec $(EMACS) --no-site-file --no-site-lisp --batch \ | ||
$(EMACSFLAGS) \ | ||
-l test/run-tests | ||
|
||
%.elc : %.el | ||
@$(CASK) exec $(EMACS) --no-site-file --no-site-lisp --batch \ | ||
$(EMACSFLAGS) \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0.4.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
;;; gitlab-api.el --- Gitlab API settings. | ||
|
||
;; Copyright (C) 2014 Nicolas Lamirault <[email protected]> | ||
;; Copyright (C) 2014, 2015 Nicolas Lamirault <[email protected]> | ||
|
||
;; This program is free software; you can redistribute it and/or | ||
;; modify it under the terms of the GNU General Public License | ||
|
@@ -55,8 +55,14 @@ Use `gitlab-username' or GITLAB_USERNAME environment variable" | |
Use `gitlab-password' or GITLAB_PASSWORD environment variable" | ||
(if gitlab-password | ||
gitlab-password | ||
(getenv "GITLAB_PASSWORD"))) | ||
|
||
(getenv "GITLAB_PASSWORD"))) | ||
|
||
(defun gitlab--get-token-id () | ||
"Retrieve the Gitlab token ID. | ||
Use `gitlab-token-id' or GITLAB_TOKEN_ID environment variable" | ||
(if gitlab-token-id | ||
gitlab-token-id | ||
(getenv "GITLAB_TOKEN_ID"))) | ||
|
||
(provide 'gitlab-api) | ||
;;; gitlab-api.el ends here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
;;; gitlab-issues.el --- Issues API | ||
|
||
;; Copyright (C) 2014 Nicolas Lamirault <[email protected]> | ||
;; Copyright (C) 2014, 2015 Nicolas Lamirault <[email protected]> | ||
|
||
;; This program is free software; you can redistribute it and/or | ||
;; modify it under the terms of the GNU General Public License | ||
|
@@ -39,21 +39,27 @@ LABELS - Comma-separated list of label names" | |
;; (add-to-list params (cons "state" state))) | ||
;; (when labels | ||
;; (add-to-list params (cons "labels" labels))) | ||
(perform-gitlab-request "issues" params 200))) | ||
(perform-gitlab-request "GET" "issues" params 200))) | ||
|
||
|
||
(defun gitlab--get-issue-uri (project-id issue-id) | ||
"Retrieve URI to retrieve an issue. | ||
PROJECT-ID : The ID of a project | ||
ISSUE-ID : The ID of a project issue" | ||
(s-concat "projects/" | ||
(number-to-string project-id) | ||
(url-hexify-string | ||
(format "%s" project-id)) | ||
"/issues/" | ||
(number-to-string issue-id))) | ||
issue-id)) | ||
|
||
(defun gitlab-list-project-issues (project-id) | ||
"Get a list of project issues. | ||
PROJECT-ID : The ID of a project" | ||
(perform-gitlab-request (s-concat "projects/" | ||
(number-to-string project-id) | ||
(perform-gitlab-request "GET" | ||
(s-concat "projects/" | ||
(url-hexify-string | ||
(format "%s" project-id)) | ||
"/issues") | ||
nil | ||
200)) | ||
|
@@ -63,10 +69,74 @@ PROJECT-ID : The ID of a project" | |
PROJECT-ID : The ID of a project | ||
ISSUE-ID : The ID of a project issue" | ||
(perform-gitlab-request (gitlab--get-issue-uri project-id issue-id) | ||
(perform-gitlab-request "GET" | ||
(gitlab--get-issue-uri | ||
(url-hexify-string | ||
(format "%s" project-id)) | ||
(format "%s" issue-id)) | ||
nil | ||
200)) | ||
|
||
(defun gitlab-create-issue (project-id title &optional description assignee milestone labels) | ||
"Create a project issue. | ||
PROJECT-ID the ID or NAMESPACE%2FPROJECT_NAME of a project | ||
TITLE issue title | ||
DESCRIPTION issue description | ||
ASSIGNEE assignee ID | ||
MILESTONE milestone ID | ||
LABELS comma-separated list label names" | ||
(lwarn '(gitlab) :debug "Create ISSUE in project: %s" project-id) | ||
(perform-gitlab-request "POST" | ||
(format "projects/%s/issues" | ||
(url-hexify-string | ||
(format "%s" project-id))) | ||
(format "title=%s%s" | ||
title | ||
(concat | ||
(when description | ||
(format "&description=%s" description)) | ||
(when assignee | ||
(format "&assignee_id=%s" assignee)) | ||
(when milestone | ||
(format "&milestone_id=%s" milestone)) | ||
(when labels | ||
(format "&labels=%s" labels)) | ||
)) | ||
201)) | ||
|
||
(defun gitlab-edit-issue (project-id issue-id &optional title description assignee-id milestone-id labels state-event) | ||
"Create a project issue. | ||
PROJECT-ID the ID or NAMESPACE%2FPROJECT_NAME of a project | ||
TITLE issue title | ||
DESCRIPTION issue description | ||
ASSIGNEE assignee ID | ||
MILESTONE milestone ID | ||
LABELS comma-separated list label names" | ||
(lwarn '(gitlab) :debug "UPDATE ISSUE in project: %s\n" project-id) | ||
(perform-gitlab-request "PUT" | ||
(format "projects/%s/issues/%s" | ||
(url-hexify-string | ||
(format "%s" project-id)) | ||
issue-id) | ||
|
||
(format "%s" | ||
(concat | ||
(when title | ||
(format "&title=%s" title)) | ||
(when description | ||
(format "&description=%s" description)) | ||
(when assignee-id | ||
(format "&assignee_id=%s" assignee-id)) | ||
(when milestone-id | ||
(format "&milestone_id=%s" milestone-id)) | ||
(when labels | ||
(format "&labels=%s" labels)) | ||
(when state-event | ||
(format "&state_event=%s" state-event)))) | ||
200)) | ||
|
||
|
||
(provide 'gitlab-issues) | ||
;;; gitlab-issues.el ends here |
Oops, something went wrong.