Skip to content

Commit

Permalink
Merge branch 'master' into release/0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
grokys committed Jul 12, 2018
2 parents 2aa8f53 + 40c4592 commit f71535e
Show file tree
Hide file tree
Showing 22 changed files with 835 additions and 6 deletions.
28 changes: 27 additions & 1 deletion Octokit.GraphQL.IntegrationTests/Queries/RepositoryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,32 @@ public void Should_Query_All_RepositoryOwner_Repositories()
Assert.Contains("go-octokit", repositoryNames);
}

[IntegrationTest]
public void Should_Run_Readme_Query()
{
var query = new Query()
.RepositoryOwner(Var("owner"))
.Repository(Var("name"))
.Select(repo => new
{
repo.Id,
repo.Name,
repo.Owner.Login,
repo.IsFork,
repo.IsPrivate,
}).Compile();

var vars = new Dictionary<string, object>
{
{ "owner", "octokit" },
{ "name", "octokit.graphql.net" },
};

var result = Connection.Run(query, vars).Result;
Assert.Equal(result.Login, "octokit");
Assert.Equal(result.Name, "octokit.graphql.net");
}

[IntegrationTest]
public void Should_Query_Repository_ByName()
{
Expand Down Expand Up @@ -94,7 +120,7 @@ public void Should_Query_Repository_With_Variables()

Assert.Equal("octokit.net", repositoryName);
}

[IntegrationTest]
public async Task Should_Query_Repository_Issues_PullRequests_With_Variables_AutoPaging()
{
Expand Down
6 changes: 6 additions & 0 deletions Octokit.GraphQL.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_ACCESSORHOLDER_ATTRIBUTE_ON_SAME_LINE_EX/@EntryValue">NEVER</s:String>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_AFTER_TYPECAST_PARENTHESES/@EntryValue">False</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpAttributeForSingleLineMethodUpgrade/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpPlaceEmbeddedOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpRenamePlacementToArrangementMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EAddAccessorOwnerDeclarationBracesMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002ECSharpPlaceAttributeOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateThisQualifierSettings/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
68 changes: 68 additions & 0 deletions Octokit.GraphQL/Model/CheckAnnotation.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
namespace Octokit.GraphQL.Model
{
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using Octokit.GraphQL.Core;
using Octokit.GraphQL.Core.Builders;

/// <summary>
/// A single check annotation.
/// </summary>
public class CheckAnnotation : QueryableValue<CheckAnnotation>
{
public CheckAnnotation(Expression expression) : base(expression)
{
}

/// <summary>
/// The path to the file that this annotation was made on.
/// </summary>
public string BlobUrl { get; }

/// <summary>
/// Identifies the primary key from the database.
/// </summary>
public int? DatabaseId { get; }

/// <summary>
/// The ending line for this annotation.
/// </summary>
public int EndLine { get; }

/// <summary>
/// The filename that this annotation was made on.
/// </summary>
public string Filename { get; }

/// <summary>
/// The annotation's message.
/// </summary>
public string Message { get; }

/// <summary>
/// Additional information about the annotation.
/// </summary>
public string RawDetails { get; }

/// <summary>
/// The starting line for this annotation.
/// </summary>
public int StartLine { get; }

/// <summary>
/// The annotation's title
/// </summary>
public string Title { get; }

/// <summary>
/// The annotation's severity level.
/// </summary>
public CheckAnnotationLevel? WarningLevel { get; }

internal static CheckAnnotation Create(Expression expression)
{
return new CheckAnnotation(expression);
}
}
}
45 changes: 45 additions & 0 deletions Octokit.GraphQL/Model/CheckAnnotationConnection.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
namespace Octokit.GraphQL.Model
{
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using Octokit.GraphQL.Core;
using Octokit.GraphQL.Core.Builders;

/// <summary>
/// The connection type for CheckAnnotation.
/// </summary>
public class CheckAnnotationConnection : QueryableValue<CheckAnnotationConnection>, IPagingConnection<CheckAnnotation>
{
public CheckAnnotationConnection(Expression expression) : base(expression)
{
}

/// <summary>
/// A list of edges.
/// </summary>
public IQueryableList<CheckAnnotationEdge> Edges => this.CreateProperty(x => x.Edges);

/// <summary>
/// A list of nodes.
/// </summary>
public IQueryableList<CheckAnnotation> Nodes => this.CreateProperty(x => x.Nodes);

/// <summary>
/// Information to aid in pagination.
/// </summary>
public PageInfo PageInfo => this.CreateProperty(x => x.PageInfo, Octokit.GraphQL.Model.PageInfo.Create);

/// <summary>
/// Identifies the total count of items in the connection.
/// </summary>
public int TotalCount { get; }

IPageInfo IPagingConnection.PageInfo => PageInfo;

internal static CheckAnnotationConnection Create(Expression expression)
{
return new CheckAnnotationConnection(expression);
}
}
}
33 changes: 33 additions & 0 deletions Octokit.GraphQL/Model/CheckAnnotationEdge.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
namespace Octokit.GraphQL.Model
{
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using Octokit.GraphQL.Core;
using Octokit.GraphQL.Core.Builders;

/// <summary>
/// An edge in a connection.
/// </summary>
public class CheckAnnotationEdge : QueryableValue<CheckAnnotationEdge>
{
public CheckAnnotationEdge(Expression expression) : base(expression)
{
}

/// <summary>
/// A cursor for use in pagination.
/// </summary>
public string Cursor { get; }

/// <summary>
/// The item at the end of the edge.
/// </summary>
public CheckAnnotation Node => this.CreateProperty(x => x.Node, Octokit.GraphQL.Model.CheckAnnotation.Create);

internal static CheckAnnotationEdge Create(Expression expression)
{
return new CheckAnnotationEdge(expression);
}
}
}
32 changes: 32 additions & 0 deletions Octokit.GraphQL/Model/CheckAnnotationLevel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using System;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

namespace Octokit.GraphQL.Model
{
/// <summary>
/// Represents an annotation's information level.
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum CheckAnnotationLevel
{
/// <summary>
/// An annotation indicating an inescapable error.
/// </summary>
[EnumMember(Value = "FAILURE")]
Failure,

/// <summary>
/// An annotation indicating some information.
/// </summary>
[EnumMember(Value = "NOTICE")]
Notice,

/// <summary>
/// An annotation indicating an ignorable error.
/// </summary>
[EnumMember(Value = "WARNING")]
Warning,
}
}
50 changes: 50 additions & 0 deletions Octokit.GraphQL/Model/CheckConclusionState.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
using System;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

namespace Octokit.GraphQL.Model
{
/// <summary>
/// The possible states for a check suite or run conclusion.
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum CheckConclusionState
{
/// <summary>
/// The check suite or run requires action.
/// </summary>
[EnumMember(Value = "ACTION_REQUIRED")]
ActionRequired,

/// <summary>
/// The check suite or run has timed out.
/// </summary>
[EnumMember(Value = "TIMED_OUT")]
TimedOut,

/// <summary>
/// The check suite or run has been cancelled.
/// </summary>
[EnumMember(Value = "CANCELLED")]
Cancelled,

/// <summary>
/// The check suite or run has failed.
/// </summary>
[EnumMember(Value = "FAILURE")]
Failure,

/// <summary>
/// The check suite or run has succeeded.
/// </summary>
[EnumMember(Value = "SUCCESS")]
Success,

/// <summary>
/// The check suite or run was neutral.
/// </summary>
[EnumMember(Value = "NEUTRAL")]
Neutral,
}
}
Loading

0 comments on commit f71535e

Please sign in to comment.