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

samsmithnz / AzurePipelinesToGitHubActionsConverterWeb / 16726922363

04 Aug 2025 03:07PM UTC coverage: 0.0% (-92.4%) from 92.429%
16726922363

push

github

web-flow
Bump AzurePipelinesToGitHubActionsConverter.Core from 1.3.65 to 1.3.66 (#351)

---
updated-dependencies:
- dependency-name: AzurePipelinesToGitHubActionsConverter.Core
  dependency-version: 1.3.66
  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 %.

0 of 638 relevant lines covered (0.0%)

0.0 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
            if (!ModelState.IsValid)
×
37
            {
×
38
                // If model state is invalid, return to the form with an empty result
39
                ConversionResponse emptyResult = new ConversionResponse();
×
40
                return View(model: (emptyResult, chkAddWorkflowDispatch));
×
41
            }
42

43
            (ConversionResponse, bool) gitHubResult = ProcessConversion(txtAzurePipelinesYAML, chkAddWorkflowDispatch);
×
44

45
            return View(model: gitHubResult);
×
46
        }
×
47

48
        private (ConversionResponse, bool) ProcessConversion(string input, bool chkAddWorkflowDispatch = false)
49
        {
×
50
            if (string.IsNullOrEmpty(input) == false)
×
51
            {
×
52
                input = input.TrimStart().TrimEnd();
×
53
            }
×
54

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

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

112

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

122
        [HttpGet]
123
        [HttpPost]
124
        public IActionResult DotNetFrameworkDesktopExample(bool chkAddWorkflowDispatch = false)
125
        {
×
126
            if (!ModelState.IsValid)
×
127
            {
×
128
                return RedirectToAction(nameof(Index));
×
129
            }
130

131
            string yaml = Examples.DotNetFrameworkDesktopExample();
×
132
            (ConversionResponse, bool) gitHubResult = ProcessConversion(yaml, chkAddWorkflowDispatch);
×
133
            return View(viewName: "Index", model: gitHubResult);
×
134
        }
×
135

136
        [HttpGet]
137
        [HttpPost]
138
        public IActionResult ASPDotNetFrameworkExample(bool chkAddWorkflowDispatch = false)
139
        {
×
140
            if (!ModelState.IsValid)
×
141
            {
×
142
                return RedirectToAction(nameof(Index));
×
143
            }
144

145
            string yaml = Examples.ASPDotNetFrameworkExample();
×
146
            (ConversionResponse, bool) gitHubResult = ProcessConversion(yaml, chkAddWorkflowDispatch);
×
147
            return View(viewName: "Index", model: gitHubResult);
×
148
        }
×
149

150
        [HttpGet]
151
        [HttpPost]
152
        public IActionResult NodeExample(bool chkAddWorkflowDispatch = false)
153
        {
×
154
            if (!ModelState.IsValid)
×
155
            {
×
156
                return RedirectToAction(nameof(Index));
×
157
            }
158

159
            string yaml = Examples.NodeExample();
×
160
            (ConversionResponse, bool) gitHubResult = ProcessConversion(yaml, chkAddWorkflowDispatch);
×
161
            return View(viewName: "Index", model: gitHubResult);
×
162
        }
×
163

164
        [HttpGet]
165
        [HttpPost]
166
        public IActionResult CIExample(bool chkAddWorkflowDispatch = false)
167
        {
×
168
            if (!ModelState.IsValid)
×
169
            {
×
170
                return RedirectToAction(nameof(Index));
×
171
            }
172

173
            string yaml = Examples.CIExample();
×
174
            (ConversionResponse, bool) gitHubResult = ProcessConversion(yaml, chkAddWorkflowDispatch);
×
175
            return View(viewName: "Index", model: gitHubResult);
×
176
        }
×
177

178
        [HttpGet]
179
        [HttpPost]
180
        public IActionResult CDExample(bool chkAddWorkflowDispatch = false)
181
        {
×
182
            if (!ModelState.IsValid)
×
183
            {
×
184
                return RedirectToAction(nameof(Index));
×
185
            }
186

187
            string yaml = Examples.CDExample();
×
188
            (ConversionResponse, bool) gitHubResult = ProcessConversion(yaml, chkAddWorkflowDispatch);
×
189
            return View(viewName: "Index", model: gitHubResult);
×
190
        }
×
191

192
        [HttpGet]
193
        [HttpPost]
194
        public IActionResult CICDExample(bool chkAddWorkflowDispatch = false)
195
        {
×
196
            if (!ModelState.IsValid)
×
197
            {
×
198
                return RedirectToAction(nameof(Index));
×
199
            }
200

201
            string yaml = Examples.CICDExample();
×
202
            (ConversionResponse, bool) gitHubResult = ProcessConversion(yaml, chkAddWorkflowDispatch);
×
203
            return View(viewName: "Index", model: gitHubResult);
×
204
        }
×
205

206
        [HttpGet]
207
        [HttpPost]
208
        public IActionResult DockerExample(bool chkAddWorkflowDispatch = false)
209
        {
×
210
            if (!ModelState.IsValid)
×
211
            {
×
212
                return RedirectToAction(nameof(Index));
×
213
            }
214

215
            string yaml = Examples.DockerExample();
×
216
            (ConversionResponse, bool) gitHubResult = ProcessConversion(yaml, chkAddWorkflowDispatch);
×
217
            return View(viewName: "Index", model: gitHubResult);
×
218
        }
×
219

220
        [HttpGet]
221
        [HttpPost]
222
        public IActionResult AntExample(bool chkAddWorkflowDispatch = false)
223
        {
×
224
            if (!ModelState.IsValid)
×
225
            {
×
226
                return RedirectToAction(nameof(Index));
×
227
            }
228

229
            string yaml = Examples.AntExample();
×
230
            (ConversionResponse, bool) gitHubResult = ProcessConversion(yaml, chkAddWorkflowDispatch);
×
231
            return View(viewName: "Index", model: gitHubResult);
×
232
        }
×
233

234
        [HttpGet]
235
        [HttpPost]
236
        public IActionResult GradleExample(bool chkAddWorkflowDispatch = false)
237
        {
×
238
            if (!ModelState.IsValid)
×
239
            {
×
240
                return RedirectToAction(nameof(Index));
×
241
            }
242

243
            string yaml = Examples.GradleExample();
×
244
            (ConversionResponse, bool) gitHubResult = ProcessConversion(yaml, chkAddWorkflowDispatch);
×
245
            return View(viewName: "Index", model: gitHubResult);
×
246
        }
×
247

248
        [HttpGet]
249
        [HttpPost]
250
        public IActionResult MavenExample(bool chkAddWorkflowDispatch = false)
251
        {
×
252
            if (!ModelState.IsValid)
×
253
            {
×
254
                return RedirectToAction(nameof(Index));
×
255
            }
256

257
            string yaml = Examples.MavenExample();
×
258
            (ConversionResponse, bool) gitHubResult = ProcessConversion(yaml, chkAddWorkflowDispatch);
×
259
            return View(viewName: "Index", model: gitHubResult);
×
260
        }
×
261

262
        [HttpGet]
263
        [HttpPost]
264
        public IActionResult PythonExample(bool chkAddWorkflowDispatch = false)
265
        {
×
266
            if (!ModelState.IsValid)
×
267
            {
×
268
                return RedirectToAction(nameof(Index));
×
269
            }
270

271
            string yaml = Examples.PythonExample();
×
272
            (ConversionResponse, bool) gitHubResult = ProcessConversion(yaml, chkAddWorkflowDispatch);
×
273
            return View(viewName: "Index", model: gitHubResult);
×
274
        }
×
275

276
        [HttpGet]
277
        [HttpPost]
278
        public IActionResult RubyExample(bool chkAddWorkflowDispatch = false)
279
        {
×
280
            if (!ModelState.IsValid)
×
281
            {
×
282
                return RedirectToAction(nameof(Index));
×
283
            }
284

285
            string yaml = Examples.RubyExample();
×
286
            (ConversionResponse, bool) gitHubResult = ProcessConversion(yaml, chkAddWorkflowDispatch);
×
287
            return View(viewName: "Index", model: gitHubResult);
×
288
        }
×
289

290
        public IActionResult Privacy()
291
        {
×
292
            return View();
×
293
        }
×
294

295
        [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
296
        public IActionResult Error()
297
        {
×
298
            return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
×
299
        }
×
300
    }
301
}
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