mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-04 19:26:51 +00:00
@@ -342,7 +342,7 @@ namespace Octokit.Tests.Integration.Clients
|
||||
var actualHook = await github.Repository.Hooks.Edit(_fixture.RepositoryId, _fixture.ExpectedHooks[1].Id, editRepositoryHook);
|
||||
|
||||
var expectedConfig = new Dictionary<string, string> { { "content_type", "json" }, { "url", "http://test.com/example" } };
|
||||
Assert.Equal(new[] { "deployment", "pull_request" }.ToList(), actualHook.Events.ToList());
|
||||
Assert.Equal(new[] { "push", "pull_request" }.ToList(), actualHook.Events.ToList());
|
||||
Assert.Equal(expectedConfig.Keys, actualHook.Config.Keys);
|
||||
Assert.Equal(expectedConfig.Values, actualHook.Config.Values);
|
||||
}
|
||||
@@ -378,7 +378,7 @@ namespace Octokit.Tests.Integration.Clients
|
||||
var actualHook = await github.Repository.Hooks.Edit(_fixture.RepositoryId, _fixture.ExpectedHooks[3].Id, editRepositoryHook);
|
||||
|
||||
var expectedConfig = new Dictionary<string, string> { { "project", "GEZDGORQFY2TCNZRGY2TSMBVGUYDK" } };
|
||||
Assert.Equal(new[] { "deployment", "pull_request" }.ToList(), actualHook.Events.ToList());
|
||||
Assert.Equal(new[] { "push", "pull_request" }.ToList(), actualHook.Events.ToList());
|
||||
Assert.Equal(expectedConfig.Keys, actualHook.Config.Keys);
|
||||
Assert.Equal(expectedConfig.Values, actualHook.Config.Values);
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace Octokit.Tests.Integration.fixtures
|
||||
CreateHook(_github, _repository, "awsopsworks", "push"),
|
||||
CreateHook(_github, _repository, "activecollab", "push"),
|
||||
CreateHook(_github, _repository, "acunote", "push"),
|
||||
CreateHook(_github, _repository, "agilebench", "push")
|
||||
CreateHook(_github, _repository, "agilezen", "push")
|
||||
};
|
||||
_hook = _hooks[0];
|
||||
}
|
||||
|
||||
@@ -1,3 +1,44 @@
|
||||
### New in 0.21.0 (released 2016/07/29)
|
||||
|
||||
**Features**
|
||||
|
||||
This release adds support across Octokit.net for providing the repository Id
|
||||
rather than a name/owner pair. The repository Id does not change when transferring
|
||||
ownership of a repository, and is more robust for API callers. This work
|
||||
was lead by @dampir as part of Google Summer of Code 2016.
|
||||
|
||||
- Added new fields for Deployment and DeploymentStatus preview API - #1365 via @ErikSchierboom
|
||||
- Added new fields for signature verification to Git Data Tag API - #1420 via @Sarmad93
|
||||
- Added new fields for GitHub Pages preview API - #1421 via @dampir
|
||||
|
||||
**Fixes**
|
||||
|
||||
- Fix serialization of enum value attributes - #1402 via @maddin2016
|
||||
- Fix searching for repositories with underscore in name - #1418 via @dsplaisted, @shiftkey
|
||||
|
||||
**Other**
|
||||
|
||||
- Clarified obsolete warnings for Protected Branch preview API - #1428 via @ryangribble
|
||||
- Remove Obsolete items - #1422 via @ryangribble
|
||||
|
||||
**Breaking Changes**
|
||||
|
||||
After a long grace period, #1422 has removed these obsoleted members. These features
|
||||
exist in other parts of the API surface:
|
||||
|
||||
- `I(Observable)GitHubClient.Release`
|
||||
- `I(Observable)GitHubClient.Notification`
|
||||
- `I(Observable)GitHubClient.GitDatabase`
|
||||
- `I(Observable)GitHubClient.SshKey`
|
||||
- `I(Observable)GitHubClient.Repository.RepositoryComments`
|
||||
- `I(Observable)GitHubClient.Repository.CommitStatus`
|
||||
- `I(Observable)GitHubClient.Repository.RepoCollaborators`
|
||||
- `I(Observable)GitHubClient.Repository.Commits`
|
||||
|
||||
This method is no longer supported through the API and has been removed from Octokit.net.:
|
||||
|
||||
- `I(Observable)GitHubClient.Authorization.RevokeAllApplicationAuthentications()`
|
||||
|
||||
### New in 0.20.0 (released 2016/06/15)
|
||||
|
||||
**Features**
|
||||
|
||||
+4
-4
@@ -3,12 +3,12 @@ using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
[assembly: AssemblyProductAttribute("Octokit")]
|
||||
[assembly: AssemblyVersionAttribute("0.20.0")]
|
||||
[assembly: AssemblyFileVersionAttribute("0.20.0")]
|
||||
[assembly: AssemblyVersionAttribute("0.21.0")]
|
||||
[assembly: AssemblyFileVersionAttribute("0.21.0")]
|
||||
[assembly: ComVisibleAttribute(false)]
|
||||
namespace System {
|
||||
internal static class AssemblyVersionInformation {
|
||||
internal const string Version = "0.20.0";
|
||||
internal const string InformationalVersion = "0.20.0";
|
||||
internal const string Version = "0.21.0";
|
||||
internal const string InformationalVersion = "0.21.0";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,17 +18,17 @@ async Task Main(string[] args)
|
||||
var client = new GitHubClient(new Octokit.ProductHeaderValue("octokit.samples"));
|
||||
|
||||
//Get releases for the octokit
|
||||
var releases = await client.Release.GetAll(owner, reponame);
|
||||
var releases = await client.Repository.Release.GetAll(owner, reponame);
|
||||
releases.Select(r => new { r.Name, r.Body }).Dump("Releases");
|
||||
|
||||
//Don't want draft release and because we are using reactive the first one is the latest one.
|
||||
var latestrelease = releases.First(r => r.Draft == false).Dump("Latest Octokit");
|
||||
|
||||
//Gets the assets for the latest relase
|
||||
var assets = await client.Release.GetAllAssets(owner,reponame,latestrelease.Id);
|
||||
var assets = await client.Repository.Release.GetAllAssets(owner,reponame,latestrelease.Id);
|
||||
assets.Dump("Assets");
|
||||
var latestreleaseassetid = assets.First(a => a.Name.Contains("Reactive")).Id;
|
||||
var asset = await client.Release.GetAsset(owner,reponame,latestreleaseassetid);
|
||||
var asset = await client.Repository.Release.GetAsset(owner,reponame,latestreleaseassetid);
|
||||
asset.DownloadCount.Dump("Download Count for this release");
|
||||
|
||||
//Download the release
|
||||
|
||||
@@ -15,10 +15,10 @@ async Task Main(string[] args)
|
||||
|
||||
owner = "octokit";
|
||||
reponame = "octokit.net";
|
||||
|
||||
|
||||
var releases = await client.Release.GetAll(owner, reponame);
|
||||
|
||||
|
||||
|
||||
var releases = await client.Repository.Release.GetAll(owner, reponame);
|
||||
|
||||
// we have to build up this tag because release tags
|
||||
// are just lightweight tags. you can read more about
|
||||
// the differences between lightweight tags and annotated tags
|
||||
@@ -26,10 +26,10 @@ async Task Main(string[] args)
|
||||
|
||||
// we can fetch the tag for this release
|
||||
var reference = "tags/" + releases[0].TagName;
|
||||
var tag = await client.GitDatabase.Reference.Get(owner, reponame, reference);
|
||||
var tag = await client.Git.Reference.Get(owner, reponame, reference);
|
||||
tag.Dump();
|
||||
|
||||
// and we can fetch the commit associated with this release
|
||||
var commit = await client.GitDatabase.Commit.Get(owner, reponame, tag.Object.Sha);
|
||||
var commit = await client.Git.Commit.Get(owner, reponame, tag.Object.Sha);
|
||||
commit.Dump();
|
||||
}
|
||||
@@ -44,8 +44,8 @@ async Task Main(string[] args)
|
||||
+ DateTime.Now.ToString(),
|
||||
Encoding = EncodingType.Utf8
|
||||
};
|
||||
|
||||
var createdBlob = await client.GitDatabase.Blob
|
||||
|
||||
var createdBlob = await client.Git.Blob
|
||||
.Create(owner, reponame, newBlob);
|
||||
createdBlob.Dump();
|
||||
|
||||
@@ -57,14 +57,14 @@ async Task Main(string[] args)
|
||||
Sha = createdBlob.Sha,
|
||||
Type = TreeType.Blob
|
||||
});
|
||||
|
||||
var createdTree = await client.GitDatabase.Tree
|
||||
|
||||
var createdTree = await client.Git.Tree
|
||||
.Create(owner, reponame, newTree);
|
||||
|
||||
createdTree.Dump();
|
||||
|
||||
// 4 - this commit should build on the current master branch
|
||||
var master = await client.GitDatabase.Reference
|
||||
var master = await client.Git.Reference
|
||||
.Get(owner, reponame, "heads/master");
|
||||
|
||||
var newCommit = new NewCommit(
|
||||
@@ -72,15 +72,15 @@ async Task Main(string[] args)
|
||||
createdTree.Sha,
|
||||
new[] { master.Object.Sha })
|
||||
{ Author = new Committer(owner,email,DateTime.UtcNow)};
|
||||
|
||||
var createdCommit = await client.GitDatabase.Commit
|
||||
|
||||
var createdCommit = await client.Git.Commit
|
||||
.Create(owner, reponame, newCommit);
|
||||
|
||||
createdCommit.Dump();
|
||||
|
||||
// 5 - create a reference for the master branch
|
||||
var updateReference = new ReferenceUpdate(createdCommit.Sha);
|
||||
var updatedReference = await client.GitDatabase
|
||||
var updatedReference = await client.Git
|
||||
.Reference.Update(owner, reponame, "heads/master", updateReference);
|
||||
updatedReference.Dump();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user