• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

samsmithnz / AzurePipelinesToGitHubActionsConverterWeb / 5355709002

pending completion
5355709002

push

github

web-flow
Bump AzurePipelinesToGitHubActionsConverter.Core (#231)

Bumps [AzurePipelinesToGitHubActionsConverter.Core](https://github.com/samsmithnz/AzurePipelinesToGitHubActionsConverter) from 1.0.35 to 1.0.36.
- [Release notes](https://github.com/samsmithnz/AzurePipelinesToGitHubActionsConverter/releases)
- [Commits](https://github.com/samsmithnz/AzurePipelinesToGitHubActionsConverter/compare/1.0.35...1.0.36)

---
updated-dependencies:
- dependency-name: AzurePipelinesToGitHubActionsConverter.Core
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

0 of 62 branches covered (0.0%)

Branch coverage included in aggregate %.

454 of 609 relevant lines covered (74.55%)

0.75 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/PipelinesToActions/PipelinesToActions/Controllers/HomeController.cs
1
using AzurePipelinesToGitHubActionsConverter.Core;
2
using Microsoft.ApplicationInsights;
3
using Microsoft.AspNetCore.Mvc;
4
using Microsoft.Extensions.Logging;
5
using PipelinesToActionsWeb.Models;
6
using System;
7
using System.Diagnostics;
8

9
namespace PipelinesToActionsWeb.Controllers
10
{
11
    /// <summary>
12
    /// This controller follows the KISS principal. It's not always pretty, but HTTP server side posts was the quickest way to implement this functionality
13
    /// </summary>
14
    public class HomeController : Controller
15
    {
16
        private readonly ILogger<HomeController> _logger;
17
        private readonly TelemetryClient _telemetry;
18

19
        public HomeController(ILogger<HomeController> logger, TelemetryClient telemetry)
×
20
        {
×
21
            _logger = logger;
×
22
            _telemetry = telemetry;
×
23
        }
×
24

25
        [HttpGet]
26
        [HttpHead]
27
        public IActionResult Index()
28
        {
×
29
            ConversionResponse gitHubResult = new ConversionResponse();
×
30
            return View(viewName: "Index", model: (gitHubResult, false));
×
31
        }
×
32

33
        [HttpPost]
34
        public IActionResult Index(string txtAzurePipelinesYAML, bool chkAddWorkflowDispatch)
35
        {
×
36
            (ConversionResponse, bool) gitHubResult = ProcessConversion(txtAzurePipelinesYAML, chkAddWorkflowDispatch);
×
37

38
            return View(model: gitHubResult);
×
39
        }
×
40

41
        private (ConversionResponse, bool) ProcessConversion(string input, bool chkAddWorkflowDispatch = false)
42
        {
×
43
            if (string.IsNullOrEmpty(input) == false)
×
44
            {
×
45
                input = input.TrimStart().TrimEnd();
×
46
            }
×
47

48
            //process the yaml
49
            ConversionResponse gitHubResult;
50
            try
51
            {
×
52
                Conversion conversion = new Conversion();
×
53
                gitHubResult = conversion.ConvertAzurePipelineToGitHubAction(input, chkAddWorkflowDispatch);
×
54
            }
×
55
            catch (YamlDotNet.Core.YamlException ex)
×
56
            {
×
57
                //if the YAML conversion failed - highlight that.
58
                gitHubResult = new ConversionResponse
×
59
                {
×
60
                    actionsYaml = "Error processing YAML, it's likely the original YAML is not valid" + Environment.NewLine +
×
61
                    "Original error message: " + ex.ToString(),
×
62
                    pipelinesYaml = input
×
63
                };
×
64
            }
×
65
            catch (Exception ex)
×
66
            {
×
67
                //Otherwise something else unexpected and bad happened
68
                gitHubResult = new ConversionResponse
×
69
                {
×
70
                    actionsYaml = "Unexpected error: " + ex.ToString(),
×
71
                    pipelinesYaml = input
×
72
                };
×
73
            }
×
74

75
            //Return the result
76
            if (gitHubResult != null)
×
77
            {
×
78
                if (gitHubResult.comments != null)
×
79
                {
×
80
                    //Log conversion task errors to application insights to track tasks that can't convert
81
                    //We are only capturing the task name and frequency to help with prioritization - no YAML is to be captured!
82
                    foreach (string comment in gitHubResult.comments)
×
83
                    {
×
84
                        if (comment.IndexOf("' does not have a conversion path yet") >= 0)
×
85
                        {
×
86
                            //Log as exception to Application Insights
87
                            string task = comment.Replace("#Error: the step '", "").Replace("' does not have a conversion path yet", "");
×
88
                            _telemetry.TrackException(new Exception("Unknown Task: " + task));
×
89
                        }
×
90
                    }
×
91
                }
×
92
                return (gitHubResult, chkAddWorkflowDispatch);
×
93
            }
94
            else
95
            {
×
96
                gitHubResult = new ConversionResponse
×
97
                {
×
98
                    actionsYaml = "Unknown error",
×
99
                    pipelinesYaml = input
×
100
                };
×
101
                return (gitHubResult, chkAddWorkflowDispatch);
×
102
            }
103
        }
×
104

105

106
        //[HttpGet]
107
        //[HttpPost]
108
        //public IActionResult ASPDotNetCoreSimpleExample(bool chkAddWorkflowDispatch = false)
109
        //{
110
        //    string yaml = Examples.ASPDotNetCoreSimpleExample();
111
        //    (ConversionResponse, bool) gitHubResult = ProcessConversion(yaml, chkAddWorkflowDispatch);
112
        //    return View(viewName: "Index", model: gitHubResult);
113
        //}
114

115
        [HttpGet]
116
        [HttpPost]
117
        public IActionResult DotNetFrameworkDesktopExample(bool chkAddWorkflowDispatch = false)
118
        {
×
119
            string yaml = Examples.DotNetFrameworkDesktopExample();
×
120
            (ConversionResponse, bool) gitHubResult = ProcessConversion(yaml, chkAddWorkflowDispatch);
×
121
            return View(viewName: "Index", model: gitHubResult);
×
122
        }
×
123

124
        [HttpGet]
125
        [HttpPost]
126
        public IActionResult ASPDotNetFrameworkExample(bool chkAddWorkflowDispatch = false)
127
        {
×
128
            string yaml = Examples.ASPDotNetFrameworkExample();
×
129
            (ConversionResponse, bool) gitHubResult = ProcessConversion(yaml, chkAddWorkflowDispatch);
×
130
            return View(viewName: "Index", model: gitHubResult);
×
131
        }
×
132

133
        [HttpGet]
134
        [HttpPost]
135
        public IActionResult NodeExample(bool chkAddWorkflowDispatch = false)
136
        {
×
137
            string yaml = Examples.NodeExample();
×
138
            (ConversionResponse, bool) gitHubResult = ProcessConversion(yaml, chkAddWorkflowDispatch);
×
139
            return View(viewName: "Index", model: gitHubResult);
×
140
        }
×
141

142
        [HttpGet]
143
        [HttpPost]
144
        public IActionResult CIExample(bool chkAddWorkflowDispatch = false)
145
        {
×
146
            string yaml = Examples.CIExample();
×
147
            (ConversionResponse, bool) gitHubResult = ProcessConversion(yaml, chkAddWorkflowDispatch);
×
148
            return View(viewName: "Index", model: gitHubResult);
×
149
        }
×
150

151
        [HttpGet]
152
        [HttpPost]
153
        public IActionResult CDExample(bool chkAddWorkflowDispatch = false)
154
        {
×
155
            string yaml = Examples.CDExample();
×
156
            (ConversionResponse, bool) gitHubResult = ProcessConversion(yaml, chkAddWorkflowDispatch);
×
157
            return View(viewName: "Index", model: gitHubResult);
×
158
        }
×
159

160
        [HttpGet]
161
        [HttpPost]
162
        public IActionResult CICDExample(bool chkAddWorkflowDispatch = false)
163
        {
×
164
            string yaml = Examples.CICDExample();
×
165
            (ConversionResponse, bool) gitHubResult = ProcessConversion(yaml, chkAddWorkflowDispatch);
×
166
            return View(viewName: "Index", model: gitHubResult);
×
167
        }
×
168

169
        [HttpGet]
170
        [HttpPost]
171
        public IActionResult DockerExample(bool chkAddWorkflowDispatch = false)
172
        {
×
173
            string yaml = Examples.DockerExample();
×
174
            (ConversionResponse, bool) gitHubResult = ProcessConversion(yaml, chkAddWorkflowDispatch);
×
175
            return View(viewName: "Index", model: gitHubResult);
×
176
        }
×
177

178
        [HttpGet]
179
        [HttpPost]
180
        public IActionResult AntExample(bool chkAddWorkflowDispatch = false)
181
        {
×
182
            string yaml = Examples.AntExample();
×
183
            (ConversionResponse, bool) gitHubResult = ProcessConversion(yaml, chkAddWorkflowDispatch);
×
184
            return View(viewName: "Index", model: gitHubResult);
×
185
        }
×
186

187
        [HttpGet]
188
        [HttpPost]
189
        public IActionResult GradleExample(bool chkAddWorkflowDispatch = false)
190
        {
×
191
            string yaml = Examples.GradleExample();
×
192
            (ConversionResponse, bool) gitHubResult = ProcessConversion(yaml, chkAddWorkflowDispatch);
×
193
            return View(viewName: "Index", model: gitHubResult);
×
194
        }
×
195

196
        [HttpGet]
197
        [HttpPost]
198
        public IActionResult MavenExample(bool chkAddWorkflowDispatch = false)
199
        {
×
200
            string yaml = Examples.MavenExample();
×
201
            (ConversionResponse, bool) gitHubResult = ProcessConversion(yaml, chkAddWorkflowDispatch);
×
202
            return View(viewName: "Index", model: gitHubResult);
×
203
        }
×
204

205
        [HttpGet]
206
        [HttpPost]
207
        public IActionResult PythonExample(bool chkAddWorkflowDispatch = false)
208
        {
×
209
            string yaml = Examples.PythonExample();
×
210
            (ConversionResponse, bool) gitHubResult = ProcessConversion(yaml, chkAddWorkflowDispatch);
×
211
            return View(viewName: "Index", model: gitHubResult);
×
212
        }
×
213

214
        [HttpGet]
215
        [HttpPost]
216
        public IActionResult RubyExample(bool chkAddWorkflowDispatch = false)
217
        {
×
218
            string yaml = Examples.RubyExample();
×
219
            (ConversionResponse, bool) gitHubResult = ProcessConversion(yaml, chkAddWorkflowDispatch);
×
220
            return View(viewName: "Index", model: gitHubResult);
×
221
        }
×
222

223
        public IActionResult Privacy()
224
        {
×
225
            return View();
×
226
        }
×
227

228
        [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
229
        public IActionResult Error()
230
        {
×
231
            return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
×
232
        }
×
233
    }
234
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc