Bug 558649 - Unable to create Milestone in GitHub Repo
Summary: Unable to create Milestone in GitHub Repo
Status: RESOLVED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: GitHub (show other bugs)
Version: 5.6   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 5.7   Edit
Assignee: Thomas Wolf CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-27 08:53 EST by Davide Fazzone CLA
Modified: 2020-01-07 09:13 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Davide Fazzone CLA 2019-12-27 08:53:52 EST
I'm an admin on a private repository. Tried to create a new Milestone but I receive the following exception:

Exception in thread "main" org.eclipse.egit.github.core.client.RequestException: Invalid request.

"closed_issues", "created_at", "creator", "number", "open_issues", "url" are not permitted keys. (422)
	at org.eclipse.egit.github.core.client.GitHubClient.createException(GitHubClient.java:585)
	at org.eclipse.egit.github.core.client.GitHubClient.sendJson(GitHubClient.java:676)
	at org.eclipse.egit.github.core.client.GitHubClient.post(GitHubClient.java:795)
	at org.eclipse.egit.github.core.service.MilestoneService.createMilestone(MilestoneService.java:146)
	at org.eclipse.egit.github.core.service.MilestoneService.createMilestone(MilestoneService.java:115)
	at test.TestClass.main(TestClass.java:31)


This is my code:
		GitHubClient gheclient = new GitHubClient("github.ibm.com");
		gheclient.setOAuth2Token("XXX");
		RepositoryService repoService = new RepositoryService(gheclient);
		Repository repository = repoService.getRepository("XXX", "mytestrepo");
		
		Milestone newMile = new Milestone();
		newMile.setTitle("test");
		newMile.setState("open");
		Calendar cal = Calendar.getInstance();
		cal.set(Calendar.YEAR, 2020);
		cal.set(Calendar.YEAR, 1);
		cal.add(Calendar.DAY_OF_YEAR, 30);
		newMile.setDueOn(cal.getTime());
		MilestoneService mileService = new MilestoneService(gheclient);
		mileService.createMilestone(repository, newMile);
Comment 1 Davide Fazzone CLA 2019-12-27 08:54:18 EST
Moreover fields cannot be null (e.g. description or due date)
Comment 2 Eclipse Genie CLA 2019-12-29 10:22:10 EST
New Gerrit change created: https://git.eclipse.org/r/155094
Comment 4 Davide Fazzone CLA 2020-01-07 09:13:51 EST
just a curiosity... when there will be another maven build of the project?