Skip to content
Open
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
24 changes: 24 additions & 0 deletions ADotNet/Models/Pipelines/GithubPipelines/DotNets/EventsV2.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// ---------------------------------------------------------------------------
// Copyright (c) Hassan Habib & Shri Humrudha Jagathisun All rights reserved.
// Licensed under the MIT License.
// See License.txt in the project root for license information.
// ---------------------------------------------------------------------------

using YamlDotNet.Serialization;

namespace ADotNet.Models.Pipelines.GithubPipelines.DotNets
{
public class EventsV2

@cjdutoit cjdutoit Jan 27, 2025

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add documentation everywhere

{
[YamlMember(DefaultValuesHandling = DefaultValuesHandling.OmitDefaults)]
public PushEvent Push { get; set; }

[YamlMember(Alias = "pull_request", DefaultValuesHandling = DefaultValuesHandling.OmitDefaults)]
public PullRequestEvent PullRequest { get; set; }

public ScheduledEvent[] Schedule { get; set; }

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public ScheduledEvent[] Schedule { get; set; }
[YamlMember(DefaultValuesHandling = DefaultValuesHandling.OmitDefaults)]
public ScheduledEvent[] Schedule { get; set; }


[YamlMember(Alias = "workflow_dispatch")]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[YamlMember(Alias = "workflow_dispatch")]
[YamlMember(Alias = "workflow_dispatch", DefaultValuesHandling = DefaultValuesHandling.OmitDefaults))]

public WorkflowDispatchEvent WorkflowDispatch { get; set; }
}
}
16 changes: 16 additions & 0 deletions ADotNet/Models/Pipelines/GithubPipelines/DotNets/ScheduledEvent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// ---------------------------------------------------------------------------
// Copyright (c) Hassan Habib & Shri Humrudha Jagathisun All rights reserved.
// Licensed under the MIT License.
// See License.txt in the project root for license information.
// ---------------------------------------------------------------------------

using YamlDotNet.Serialization;

namespace ADotNet.Models.Pipelines.GithubPipelines.DotNets
{
public class ScheduledEvent

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add documentation everywhere

{
[YamlMember(Order = 0, DefaultValuesHandling = DefaultValuesHandling.OmitDefaults)]
public string Cron { get; set; }
Comment on lines +13 to +14

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[YamlMember(Order = 0, DefaultValuesHandling = DefaultValuesHandling.OmitDefaults)]
public string Cron { get; set; }
[YamlMember(Order = 0, DefaultValuesHandling = DefaultValuesHandling.OmitDefaults)]
public string Cron { get; set; }
[YamlMember(Order = 1, DefaultValuesHandling = DefaultValuesHandling.OmitDefaults)]
public string Interval { get; set; }

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// ---------------------------------------------------------------------------
// Copyright (c) Hassan Habib & Shri Humrudha Jagathisun All rights reserved.
// Licensed under the MIT License.
// See License.txt in the project root for license information.
// ---------------------------------------------------------------------------

using YamlDotNet.Serialization;

namespace ADotNet.Models.Pipelines.GithubPipelines.DotNets.Tasks
{
public class InstallPlaywrightBrowsersTask : GithubTask
{
[YamlIgnore]
public string ProjectName { get; set; }
public override string Run => $"pwsh ./{ProjectName}/bin/Debug/net9.0/playwright.ps1 install";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// ---------------------------------------------------------------------------
// Copyright (c) Hassan Habib & Shri Humrudha Jagathisun All rights reserved.
// Licensed under the MIT License.
// See License.txt in the project root for license information.
// ---------------------------------------------------------------------------

namespace ADotNet.Models.Pipelines.GithubPipelines.DotNets.Tasks
{
public class InstallPlaywrightTask : GithubTask
{
public override string Run { get; set; } = "dotnet tool install --global Microsoft.Playwright.CLI";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// ---------------------------------------------------------------------------
// Copyright (c) Hassan Habib & Shri Humrudha Jagathisun All rights reserved.
// Licensed under the MIT License.
// See License.txt in the project root for license information.
// ---------------------------------------------------------------------------

using YamlDotNet.Serialization;

namespace ADotNet.Models.Pipelines.GithubPipelines.DotNets.Tasks
{
public class RunUntilFailureTask : GithubTask
{
[YamlMember(Order = 1, Alias = "shell", DefaultValuesHandling = DefaultValuesHandling.OmitDefaults)]
public override string Shell => "bash";

[YamlMember(Order = 2, Alias = "run", DefaultValuesHandling = DefaultValuesHandling.OmitDefaults)]
public override string Run => "for i in {1..1000};" +
@" do echo ""Run #$i""; dotnet test --no-build " +
"--verbosity normal --filter 'FullyQualifiedName!~Integrations' || exit 1; done";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// ---------------------------------------------------------------------------
// Copyright (c) Hassan Habib & Shri Humrudha Jagathisun All rights reserved.
// Licensed under the MIT License.
// See License.txt in the project root for license information.
// ---------------------------------------------------------------------------

namespace ADotNet.Models.Pipelines.GithubPipelines.DotNets.Tasks
{
public class WorkloadUpdateTask : GithubTask
{
public override string Run { get; set; } = "dotnet workload update";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// ---------------------------------------------------------------------------
// Copyright (c) Hassan Habib & Shri Humrudha Jagathisun All rights reserved.
// Licensed under the MIT License.
// See License.txt in the project root for license information.
// ---------------------------------------------------------------------------

namespace ADotNet.Models.Pipelines.GithubPipelines.DotNets
{
public class WorkflowDispatchEvent
{ }

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems incomplete, I was expecting properties

Suggested change
{ }
{
[YamlMember(Order = 0, DefaultValuesHandling = DefaultValuesHandling.OmitDefaults)]
public WorkflowDispatchInput Environment { get; set; }
[YamlMember(Order = 1, DefaultValuesHandling = DefaultValuesHandling.OmitDefaults)]
public WorkflowDispatchInput Version { get; set; }
[YamlMember(Order = 2, DefaultValuesHandling = DefaultValuesHandling.OmitDefaults)]
public WorkflowDispatchInput DryRun { get; set; }
}

with

public class WorkflowDispatchInput
{
    [YamlMember(Order = 0]
    public string Description { get; set; }

    [YamlMember(Order = 1]
    public bool Required { get; set; }

    [YamlMember(Order = 2]
    public string Default { get; set; }
}

}