Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to v3.1.0 of the GitHub Terraform Provider #76

Merged
merged 1 commit into from
Oct 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ CHANGELOG
=========

## HEAD (Unreleased)
* Upgrade to v3.1.0 of the GitHub Terraform Provider
* Upgrade to pulumi-terraform-bridge v2.8.0
* Upgrade to Pulumi v2.10.0

Expand Down
223 changes: 106 additions & 117 deletions provider/cmd/pulumi-resource-github/schema.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion provider/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ require (
github.com/hashicorp/terraform-plugin-sdk v1.9.1
github.com/pulumi/pulumi-terraform-bridge/v2 v2.8.0
github.com/pulumi/pulumi/sdk/v2 v2.10.0
github.com/terraform-providers/terraform-provider-github v1.3.1-0.20200908195321-ec1ed2e044f6
github.com/terraform-providers/terraform-provider-github v1.3.1-0.20201012131225-9c532df81939
)
4 changes: 4 additions & 0 deletions provider/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,8 @@ github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0=
github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-github/v31 v31.0.0 h1:JJUxlP9lFK+ziXKimTCprajMApV1ecWD4NB6CCb0plo=
github.com/google/go-github/v31 v31.0.0/go.mod h1:NQPZol8/1sMoWYGN2yaALIBytu17gAWfhbweiEed3pM=
github.com/google/go-github/v32 v32.1.0 h1:GWkQOdXqviCPx7Q7Fj+KyPoGm4SwHRh8rheoPhd27II=
github.com/google/go-github/v32 v32.1.0/go.mod h1:rIEpZD9CTDQwDK9GDrtMTycQNA4JU3qBsCizh3q2WCI=
github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk=
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
github.com/google/go-replayers/grpcreplay v0.1.0/go.mod h1:8Ig2Idjpr6gifRd6pNVggX6TC1Zw6Jx74AKp7QNH2QE=
Expand Down Expand Up @@ -772,6 +774,8 @@ github.com/terraform-providers/terraform-provider-github v1.3.1-0.20200714231544
github.com/terraform-providers/terraform-provider-github v1.3.1-0.20200714231544-91ed9f877a34/go.mod h1:ctVieu3ueVfdSO90MNKKdG2nWo8VVQ8d5b/XfGWJNp4=
github.com/terraform-providers/terraform-provider-github v1.3.1-0.20200908195321-ec1ed2e044f6 h1:etKh6zHOyvp43WgoYocuzsRswU+COIED0iF1fmyUDSE=
github.com/terraform-providers/terraform-provider-github v1.3.1-0.20200908195321-ec1ed2e044f6/go.mod h1:+AzJdpe92BtK4jgbT02FzNou+rfBJZs1TdEYJQJDn4A=
github.com/terraform-providers/terraform-provider-github v1.3.1-0.20201012131225-9c532df81939 h1:4hpF780kTkJQWY6XuNeWFvWvbLNEtpXP1gcsSTg2QLw=
github.com/terraform-providers/terraform-provider-github v1.3.1-0.20201012131225-9c532df81939/go.mod h1:Ya0FMXPrjKFAfZ6LQP7Ks+n3ss8Y9P2gkstLBzKvcQY=
github.com/terraform-providers/terraform-provider-http v1.2.0 h1:pOP/SNlLjB18CydtTJJwzkZGkHYX3LWzIoQpYQuBdyw=
github.com/terraform-providers/terraform-provider-http v1.2.0/go.mod h1:2Iot921OkLVSZr8FbIkvRN84ZV3w+oFKb7RlmPTQQAQ=
github.com/terraform-providers/terraform-provider-openstack v1.15.0/go.mod h1:2aQ6n/BtChAl1y2S60vebhyJyZXBsuAI5G4+lHrT1Ew=
Expand Down
213 changes: 87 additions & 126 deletions sdk/dotnet/BranchProtection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,98 +13,32 @@ namespace Pulumi.Github
/// Protects a GitHub branch.
///
/// This resource allows you to configure branch protection for repositories in your organization. When applied, the branch will be protected from forced pushes and deletion. Additional constraints, such as required status checks or restrictions on users, teams, and apps, can also be configured.
///
/// ## Example Usage
///
/// ```csharp
/// using Pulumi;
/// using Github = Pulumi.Github;
///
/// class MyStack : Stack
/// {
/// public MyStack()
/// {
/// var exampleTeam = new Github.Team("exampleTeam", new Github.TeamArgs
/// {
/// });
/// // Protect the master branch of the foo repository. Additionally, require that
/// // the "ci/travis" context to be passing and only allow the engineers team merge
/// // to the branch.
/// var exampleBranchProtection = new Github.BranchProtection("exampleBranchProtection", new Github.BranchProtectionArgs
/// {
/// Branch = "master",
/// EnforceAdmins = true,
/// Repository = github_repository.Example.Name,
/// RequiredPullRequestReviews = new Github.Inputs.BranchProtectionRequiredPullRequestReviewsArgs
/// {
/// DismissStaleReviews = true,
/// DismissalTeams =
/// {
/// exampleTeam.Slug,
/// github_team.Second.Slug,
/// },
/// DismissalUsers =
/// {
/// "foo-user",
/// },
/// },
/// RequiredStatusChecks = new Github.Inputs.BranchProtectionRequiredStatusChecksArgs
/// {
/// Contexts =
/// {
/// "ci/travis",
/// },
/// Strict = false,
/// },
/// Restrictions = new Github.Inputs.BranchProtectionRestrictionsArgs
/// {
/// Apps =
/// {
/// "foo-app",
/// },
/// Teams =
/// {
/// exampleTeam.Slug,
/// },
/// Users =
/// {
/// "foo-user",
/// },
/// },
/// });
/// var exampleTeamRepository = new Github.TeamRepository("exampleTeamRepository", new Github.TeamRepositoryArgs
/// {
/// Permission = "pull",
/// Repository = github_repository.Example.Name,
/// TeamId = exampleTeam.Id,
/// });
/// }
///
/// }
/// ```
/// </summary>
public partial class BranchProtection : Pulumi.CustomResource
{
/// <summary>
/// The Git branch to protect.
/// </summary>
[Output("branch")]
public Output<string> Branch { get; private set; } = null!;

/// <summary>
/// Boolean, setting this to `true` enforces status checks for repository administrators.
/// </summary>
[Output("enforceAdmins")]
public Output<bool?> EnforceAdmins { get; private set; } = null!;

[Output("etag")]
public Output<string> Etag { get; private set; } = null!;
/// <summary>
/// Identifies the protection rule pattern.
/// </summary>
[Output("pattern")]
public Output<string> Pattern { get; private set; } = null!;

/// <summary>
/// The list of actor IDs that may push to the branch.
/// </summary>
[Output("pushRestrictions")]
public Output<ImmutableArray<string>> PushRestrictions { get; private set; } = null!;

/// <summary>
/// The GitHub repository name.
/// The repository associated with this branch protection rule.
/// </summary>
[Output("repository")]
public Output<string> Repository { get; private set; } = null!;
[Output("repositoryId")]
public Output<string> RepositoryId { get; private set; } = null!;

/// <summary>
/// Boolean, setting this to `true` requires all commits to be signed with GPG.
Expand All @@ -116,19 +50,13 @@ public partial class BranchProtection : Pulumi.CustomResource
/// Enforce restrictions for pull request reviews. See Required Pull Request Reviews below for details.
/// </summary>
[Output("requiredPullRequestReviews")]
public Output<Outputs.BranchProtectionRequiredPullRequestReviews?> RequiredPullRequestReviews { get; private set; } = null!;
public Output<ImmutableArray<Outputs.BranchProtectionRequiredPullRequestReview>> RequiredPullRequestReviews { get; private set; } = null!;

/// <summary>
/// Enforce restrictions for required status checks. See Required Status Checks below for details.
/// </summary>
[Output("requiredStatusChecks")]
public Output<Outputs.BranchProtectionRequiredStatusChecks?> RequiredStatusChecks { get; private set; } = null!;

/// <summary>
/// Enforce restrictions for the users and teams that may push to the branch. See Restrictions below for details.
/// </summary>
[Output("restrictions")]
public Output<Outputs.BranchProtectionRestrictions?> Restrictions { get; private set; } = null!;
public Output<ImmutableArray<Outputs.BranchProtectionRequiredStatusCheck>> RequiredStatusChecks { get; private set; } = null!;


/// <summary>
Expand Down Expand Up @@ -176,47 +104,65 @@ public static BranchProtection Get(string name, Input<string> id, BranchProtecti

public sealed class BranchProtectionArgs : Pulumi.ResourceArgs
{
/// <summary>
/// The Git branch to protect.
/// </summary>
[Input("branch", required: true)]
public Input<string> Branch { get; set; } = null!;

/// <summary>
/// Boolean, setting this to `true` enforces status checks for repository administrators.
/// </summary>
[Input("enforceAdmins")]
public Input<bool>? EnforceAdmins { get; set; }

/// <summary>
/// The GitHub repository name.
/// Identifies the protection rule pattern.
/// </summary>
[Input("repository", required: true)]
public Input<string> Repository { get; set; } = null!;
[Input("pattern", required: true)]
public Input<string> Pattern { get; set; } = null!;

[Input("pushRestrictions")]
private InputList<string>? _pushRestrictions;

/// <summary>
/// The list of actor IDs that may push to the branch.
/// </summary>
public InputList<string> PushRestrictions
{
get => _pushRestrictions ?? (_pushRestrictions = new InputList<string>());
set => _pushRestrictions = value;
}

/// <summary>
/// The repository associated with this branch protection rule.
/// </summary>
[Input("repositoryId", required: true)]
public Input<string> RepositoryId { get; set; } = null!;

/// <summary>
/// Boolean, setting this to `true` requires all commits to be signed with GPG.
/// </summary>
[Input("requireSignedCommits")]
public Input<bool>? RequireSignedCommits { get; set; }

/// <summary>
/// Enforce restrictions for pull request reviews. See Required Pull Request Reviews below for details.
/// </summary>
[Input("requiredPullRequestReviews")]
public Input<Inputs.BranchProtectionRequiredPullRequestReviewsArgs>? RequiredPullRequestReviews { get; set; }
private InputList<Inputs.BranchProtectionRequiredPullRequestReviewArgs>? _requiredPullRequestReviews;

/// <summary>
/// Enforce restrictions for required status checks. See Required Status Checks below for details.
/// Enforce restrictions for pull request reviews. See Required Pull Request Reviews below for details.
/// </summary>
public InputList<Inputs.BranchProtectionRequiredPullRequestReviewArgs> RequiredPullRequestReviews
{
get => _requiredPullRequestReviews ?? (_requiredPullRequestReviews = new InputList<Inputs.BranchProtectionRequiredPullRequestReviewArgs>());
set => _requiredPullRequestReviews = value;
}

[Input("requiredStatusChecks")]
public Input<Inputs.BranchProtectionRequiredStatusChecksArgs>? RequiredStatusChecks { get; set; }
private InputList<Inputs.BranchProtectionRequiredStatusCheckArgs>? _requiredStatusChecks;

/// <summary>
/// Enforce restrictions for the users and teams that may push to the branch. See Restrictions below for details.
/// Enforce restrictions for required status checks. See Required Status Checks below for details.
/// </summary>
[Input("restrictions")]
public Input<Inputs.BranchProtectionRestrictionsArgs>? Restrictions { get; set; }
public InputList<Inputs.BranchProtectionRequiredStatusCheckArgs> RequiredStatusChecks
{
get => _requiredStatusChecks ?? (_requiredStatusChecks = new InputList<Inputs.BranchProtectionRequiredStatusCheckArgs>());
set => _requiredStatusChecks = value;
}

public BranchProtectionArgs()
{
Expand All @@ -225,50 +171,65 @@ public BranchProtectionArgs()

public sealed class BranchProtectionState : Pulumi.ResourceArgs
{
/// <summary>
/// The Git branch to protect.
/// </summary>
[Input("branch")]
public Input<string>? Branch { get; set; }

/// <summary>
/// Boolean, setting this to `true` enforces status checks for repository administrators.
/// </summary>
[Input("enforceAdmins")]
public Input<bool>? EnforceAdmins { get; set; }

[Input("etag")]
public Input<string>? Etag { get; set; }
/// <summary>
/// Identifies the protection rule pattern.
/// </summary>
[Input("pattern")]
public Input<string>? Pattern { get; set; }

[Input("pushRestrictions")]
private InputList<string>? _pushRestrictions;

/// <summary>
/// The list of actor IDs that may push to the branch.
/// </summary>
public InputList<string> PushRestrictions
{
get => _pushRestrictions ?? (_pushRestrictions = new InputList<string>());
set => _pushRestrictions = value;
}

/// <summary>
/// The GitHub repository name.
/// The repository associated with this branch protection rule.
/// </summary>
[Input("repository")]
public Input<string>? Repository { get; set; }
[Input("repositoryId")]
public Input<string>? RepositoryId { get; set; }

/// <summary>
/// Boolean, setting this to `true` requires all commits to be signed with GPG.
/// </summary>
[Input("requireSignedCommits")]
public Input<bool>? RequireSignedCommits { get; set; }

/// <summary>
/// Enforce restrictions for pull request reviews. See Required Pull Request Reviews below for details.
/// </summary>
[Input("requiredPullRequestReviews")]
public Input<Inputs.BranchProtectionRequiredPullRequestReviewsGetArgs>? RequiredPullRequestReviews { get; set; }
private InputList<Inputs.BranchProtectionRequiredPullRequestReviewGetArgs>? _requiredPullRequestReviews;

/// <summary>
/// Enforce restrictions for required status checks. See Required Status Checks below for details.
/// Enforce restrictions for pull request reviews. See Required Pull Request Reviews below for details.
/// </summary>
public InputList<Inputs.BranchProtectionRequiredPullRequestReviewGetArgs> RequiredPullRequestReviews
{
get => _requiredPullRequestReviews ?? (_requiredPullRequestReviews = new InputList<Inputs.BranchProtectionRequiredPullRequestReviewGetArgs>());
set => _requiredPullRequestReviews = value;
}

[Input("requiredStatusChecks")]
public Input<Inputs.BranchProtectionRequiredStatusChecksGetArgs>? RequiredStatusChecks { get; set; }
private InputList<Inputs.BranchProtectionRequiredStatusCheckGetArgs>? _requiredStatusChecks;

/// <summary>
/// Enforce restrictions for the users and teams that may push to the branch. See Restrictions below for details.
/// Enforce restrictions for required status checks. See Required Status Checks below for details.
/// </summary>
[Input("restrictions")]
public Input<Inputs.BranchProtectionRestrictionsGetArgs>? Restrictions { get; set; }
public InputList<Inputs.BranchProtectionRequiredStatusCheckGetArgs> RequiredStatusChecks
{
get => _requiredStatusChecks ?? (_requiredStatusChecks = new InputList<Inputs.BranchProtectionRequiredStatusCheckGetArgs>());
set => _requiredStatusChecks = value;
}

public BranchProtectionState()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,26 @@
namespace Pulumi.Github.Inputs
{

public sealed class BranchProtectionRequiredPullRequestReviewsArgs : Pulumi.ResourceArgs
public sealed class BranchProtectionRequiredPullRequestReviewArgs : Pulumi.ResourceArgs
{
[Input("dismissStaleReviews")]
public Input<bool>? DismissStaleReviews { get; set; }

[Input("dismissalTeams")]
private InputList<string>? _dismissalTeams;
public InputList<string> DismissalTeams
[Input("dismissalRestrictions")]
private InputList<string>? _dismissalRestrictions;
public InputList<string> DismissalRestrictions
{
get => _dismissalTeams ?? (_dismissalTeams = new InputList<string>());
set => _dismissalTeams = value;
get => _dismissalRestrictions ?? (_dismissalRestrictions = new InputList<string>());
set => _dismissalRestrictions = value;
}

[Input("dismissalUsers")]
private InputList<string>? _dismissalUsers;
public InputList<string> DismissalUsers
{
get => _dismissalUsers ?? (_dismissalUsers = new InputList<string>());
set => _dismissalUsers = value;
}

[Input("includeAdmins")]
public Input<bool>? IncludeAdmins { get; set; }

[Input("requireCodeOwnerReviews")]
public Input<bool>? RequireCodeOwnerReviews { get; set; }

[Input("requiredApprovingReviewCount")]
public Input<int>? RequiredApprovingReviewCount { get; set; }

public BranchProtectionRequiredPullRequestReviewsArgs()
public BranchProtectionRequiredPullRequestReviewArgs()
{
}
}
Expand Down
Loading