Custom build task not showing in YAML task list - azure-devops-extensions

We wrote a custom Azure DevOps build task, but we can't find it in the YAML editor task list. It doesn't even show up in search.
This is my task.json:
{
"id": "17813657-13c6-4cd8-b245-8d8b3b0cf210",
"name": "ApplitoolsBuildTask",
"friendlyName": "Applitools Build Task",
"description": "Add the Applitools dashboard as a tab in the Azure DevOps build results page.",
"categories": [ "Build" ],
"category": "Build",
"author": "Applitools",
"version": {
"Major": 0,
"Minor": 44,
"Patch": 0
},
"instanceNameFormat": "Applitools Build Task $(version)",
"execution": {
"Node": {
"target": "dist/index.js"
}
}
}
I also tried with only categories property, and it still didn't show in the search.
I then tried downloading Augurk locally and examined its content (also available in GitHub: https://github.com/Augurk/vsts-extension/tree/master/src), and I saw in AugurkCLI it doesn't even have categories property, as it has a typo: categorues, and for some reason it still shows up. This leads me to think there's no relation between that property and the task list.
I also tried examining the XML file and saw it has <PublisherDetails> section, which my .vsix file doesn't have. What should I put in my vss-extension.json file to have it? And will it help getting my extension to show up in the Task List?
Note that in the Classic editor (the one with the UI) I see it just fine, in the right categories (if I have the "category" property), and if I don't have it then it still shows up when I search. The problem I have is to get my build-task to show up in the YAML editing Task List.

Indeed, our team is fixing this issues now. The issue caused by the YAML assistant panel doesn't allow tasks without input parameters. But worked in classic editor.
Before our fixed release deployed, you can use this workaround to achieve your customize task appeared in the YAML editor task list:
Change your script to accept an input parameter. And then the task will appeared in YAML editor task list.
You can reference this ticket we received recently. We will inform you here once we deployed the fixed release and the issue be fixed.

Well, it seems it's a bug on Microsoft side. I don't have any input fields in the build task, and the Azure DevOps YAML editor task list filters out any task that doesn't have input fields.
They told me they had fixed it:
https://developercommunity.visualstudio.com/content/problem/576169/our-custom-azure-devops-build-task-doesnt-show-in.html
The fix should be available in a few weeks.

Related

Defining a ProblemMatcher in VSCode tasks -- schema disagrees with docs?

In VSCode I'm trying to create a ProblemMatcher to parse errors on a custom script of mine which I run (markdown file -> pandoc -> PDFs if you're interested).
The pretty good VSCode ProblemMatcher documentation has an example task which appears (to me) to run a command ("command": "gcc") and define a problem matcher ("problemMatcher": {...}).
When I try this for my tasks.json file with both, I get an 'the description can't be converted into a problem matcher' error, which isn't terribly helpful. I checked the tasks.json schema and it clearly says:
The problem matcher to be used if a global command is executed (e.g. no tasks are defined). A tasks.json file can either contain a global problemMatcher property or a tasks property but not both.
Is the schema wrong? In which case I'll raise an issue.
Or is my code wrong? In which case, please point me in the right direction. Code in full (minus comments):
{
"version": "2.0.0",
"tasks": [
{
"label": "md2pdf",
"type": "shell",
"command": "md2pdf",
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"reveal": "always",
"panel": "shared",
"showReuseMessage": false
},
"problemMatcher": {
"owner": "Markdown",
"fileLocation": ["absolute", "/tmp/md2pdf.log"],
"pattern": [
{
// Regular expression to match filename (on earlier line than actual warnings)
"regexp": "^Converting:\\s+(.*)$",
"kind": "location",
"file": 1
},
{
// Regular expression to match: "l.45 \msg_fatal:nn {fontspec} {cannot-use-pdftex}" with a preceding line giving "Converting <filename>:"
"regexp": "l.(\\d+)\\s(.*):(.*)$",
"line": 1,
"severity": 2,
"message": 3
}
]
}
}]
}
I've since spent more time figuring this out, and have corresponded with VSCode team, which has led to improvements in the documentation.
The two changes needed to get something simple working were:
Need to have "command": "/full/path/to/executable" not just "executable name".
The "fileLocation" isn't about the location of the file to be matched, but about how to treat file paths mentioned in the task output. The file to be matched can't be specified, as it's implicitly the file or folder open in the editor at the time of the task. The setting wasn't important in my case.
If you, like me, have come here due to the description can't be converted into a problem matcher, here is what I learned:
If your problem matcher says something like "base": "$gcc", then I assume you are using the Microsoft C/C++ plugin. If you are using some other base which is not listed on the official docs webpage (search Tasks in Visual Studio Code), then assume that it is probably supplied by a plugin.
So, this error could mean that you are missing a plugin. In my case I was trying to run this task remotely in WSL/Ubuntu using VS Code's awesome WSL integration. I installed the C/C++ plugin inside WSL and the error was fixed (go to the extension panel, click Install in WSL: <Distro name>).
Just a hunch, but I bet your fileLocation is wrong. Try something like
"fileLocation": "absolute",

global evaluation is not supported on Vscode when use shift+r flutter

When I use hot reload on my debug console it says "global evaluation not supported". How do I fix this problem?
Before I read this global evaluation, but it did not help me
This is the image of my problem
Add configuration "console":"terminal" in launch.json
Example:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "dart_application_1",
"request": "launch",
"type": "dart",
"program": "bin/dart_application_1.dart",
"console": "terminal"
}
]
}
More details available here
The VS Code debugger for Dart/Flutter does not currently support global evaluation (there's an open issue for this here). Add a 👍 to that issue if it's something you'd like to see.
The debug console can be used for evaluation when execution is paused (eg. you've stopped at a breakpoint or similar) - this is evaluation in the context of the current frame.
Just remember to update your name to your project name and then again on the program setting AFTER the bin/ ;)

Unable to get the result from Google machine learning Cloud REST API

I am trying to run a job using Google Cloud Machine Learning REST-API ml.jobs.project.create
The latest job that I submitted has job id 'drivermonitoring20180109335'. Here on completion of the job, message 'job completed successfully' is displayed but I cannot see any desired output file in the specified location. Output logs can be seen in fig1
Also I would like to keep in-front of you my few observations while running this job id:
i) Running the job took very less time in comparison to any other job that I executed before.
ii) While running jobs before, every job earlier was executed via two different tasks viz a)master-replica-0 and b)service (refer fig2) but this job didn't have master-replica-0 task(refer fig3) I tried to Google the issue, but was unable to find any solution related to the issue.
So I can infer that the task that I was trying to run is being scheduled but the python script that I am trying to run is never scheduled to be executed.
Kindly let me know if you require more screenshots or if you want to have a look at the project structure to help with the issue.
Thanks in advance.
EDIT 1: Added JSON while making API call
POST https://ml.googleapis.com/v1/projects/drivermonitoringsystem/jobs?key={YOUR_API_KEY}
{
"trainingInput": {
"pythonModule": "trainer.retrain",
"args": [
"--bottleneck_dir=ModelTraining/tf_files/bottlenecks \
--model_dir=ModelTraining/tf_files/models/ \
--architecture=mobilenet_0.50_224 \
--output_graph=gs://<BUCKET_NAME>/tf_files/retrained_graph.pb \
--output_labels=gs://<BUCKET_NAME>/tf_files/retrained_labels.txt \
--image_dir=gs://<BUCKET_NAME>/dataset224x224/"
],
"region": "us-central1",
"packageUris": [
"gs://<BUCKET_NAME>/ModelTraining4.tar.gz"
],
"jobDir": "gs://<BUCKET_NAME>/tf_files/",
"runtimeVersion": "1.4"
},
"jobId": "job_id201801101535"
}
I have just run myself some sample jobs using both the gcloud command and the REST API, and everything has just worked fine in both of the cases. It looks like, in your case, the job was never executed, as there is no cluster created for processing the job itself (that is why master-replica-0 is missing).
The jobs that you had run previously and which had worked were launched also using the REST API, or instead with gcloud or a Client Library?
Here I share an example JSON I used when making the API call to ml.projects.jobs.create through the API Explorer link you shared, I suggest you try adapting it to your requirements and check if you got any missing field:
POST https://ml.googleapis.com/v1/projects/<YOUR_PROJECT>/jobs?key={YOUR_API_KEY}
{
"jobId": "<JOB_ID>",
"trainingInput": {
"jobDir": "gs://<LOCATION_TO_STORE_OUTPUTS>",
"runtimeVersion": "1.4",
"region": "<REGION>",
"packageUris": [
"gs://<PATH_TO_YOUR_TRAINER>/trainer-0.0.0.tar.gz"
],
"pythonModule": "<PYTHON_MODULE_TO_RUN>",
"args": [
"--train-files",
"gs://<PATH_TO_YOUR_TRAINING_DATA>/data.csv",
"--eval-files",
"gs://<PATH_TO_YOUR_TEST_DATA>/test.csv",
"--train-steps",
"100",
"--eval-steps",
"10",
"--verbosity",
"DEBUG"
]
}
}
Change TrainingInput to PredictionInput (and the appropriate child fields) if you are trying to run a prediction job instead of a training one, as in this example.

How do I figure out what found-elasticsearch version is running on heroku?

Heroku says I am running elasticsearch version 2.2.0 but I think they are wrong and here is why...
Locally on 2.2.0, my mappings include the payloads: true option as defined here - and they work just fine. However, on heroku I get empty responses. If I remove this option and construct the mapping in accordance with the "2.x" docs then it works on heroku but responses are empty locally. What does 2.x mean exactly? How can I find the real version running on heroku?
Thank you.
Found-ElasticSearch:
{
"name": "instance-x",
"cluster_name": "x",
"version": {
"number": "2.2.0",
"build_hash": "1b182b4497d4bba7602085ebd2e59a8a555ad368",
"build_timestamp": "2016-01-14T13:42:27Z",
"build_snapshot": true,
"lucene_version": "5.4.0"
},
"tagline": "You Know, for Search"
}
Local:
{
"name": "Power Princess",
"cluster_name": "elasticsearch_brew",
"version": {
"number": "2.2.0",
"build_hash": "8ff36d139e16f8720f2947ef62c8167a888992fe",
"build_timestamp": "2016-01-27T13:32:39Z",
"build_snapshot": false,
"lucene_version": "5.4.1"
},
"tagline": "You Know, for Search"
}
I notice lucene and build_snapshot are different. The lucene version only has bugfixes that are nothing to do with payloads. So what is the build_snapshot and could that be affecting it?
You can use the build_hash values in order to figure out the difference between both builds. The one deployed on Found dates back from January 14th, 2016 and the one on Heroku from January 27th, 2016, i.e. 13 days. According to build_snapshot, the one on Found is not a release artifact, but a snapshot artifact.
So let's look at the differences between both artifacts on Github using the build hashes above:
13 days worth of commits
49 commits
191 changes files
And somewhere in there we find the commit db409c99 which includes changes in the CompletionFieldMapper and the payloads field has been added.
Glancing through the commits, we can find that they had to revert the new completion suggester changes because it was breaking other parts. It will be re-introduced in a major version (3.0).
So, to sum up, the local version you have includes the payloads field, while the one you have on Found doesn't, which explains the behavior you're seeing.

TFS Build 2015 not publishing test results

UPDATE (I have restructured this question with a new and basic solution and build as the same problem exists there)
I'm using the new build system in Tfs 2015 and I'm using Update 1. I have noticed that on the build summary screen, no test results or Code Coverage results are submitted:
I have a test step which runs and contains results and I have a .trx and a .coverage file but the test step log contains the warning:
##[warning]Failed to publish test results: The value for the Build.Id property is not within the permissible values for it.
The Build is very basic, it contains 2 steps and Code Coverage is Enabled on the test step:
Here is the build def as retrieved by the TEST REST API:
{
"build":[
{
"enabled":true,
"continueOnError":false,
"alwaysRun":false,
"displayName":"Build solution $/IsdDev/SQTestBuild/Main/TestBuildSystem.sln",
"task":{
"id":"71a9a2d3-a98a-4caa-96ab-affca411ecda",
"versionSpec":"*"
},
"inputs":{
"solution":"$/IsdDev/SQTestBuild/Main/TestBuildSystem.sln",
"msbuildArgs":"",
"platform":"$(BuildPlatform)",
"configuration":"$(BuildConfiguration)",
"clean":"false",
"restoreNugetPackages":"true",
"vsVersion":"14.0",
"msbuildArchitecture":"x86",
"logProjectEvents":"true"
}
},
{
"enabled":true,
"continueOnError":false,
"alwaysRun":false,
"displayName":"Test Assemblies **\\$(BuildConfiguration)\\*test*.dll;-:**\\obj\\**",
"task":{
"id":"ef087383-ee5e-42c7-9a53-ab56c98420f9",
"versionSpec":"*"
},
"inputs":{
"testAssembly":"**\\$(BuildConfiguration)\\*test*.dll;-:**\\obj\\**",
"testFiltercriteria":"",
"platform":"$(BuildPlatform)",
"configuration":"$(BuildConfiguration)",
"runSettingsFile":"",
"overrideTestrunParameters":"",
"codeCoverageEnabled":"true",
"vsTestVersion":"14.0",
"pathtoCustomTestAdapters":"",
"otherConsoleOptions":""
}
}
],
"options":[
{
"enabled":false,
"definition":{
"id":"7c555368-ca64-4199-add6-9ebaf0b0137d"
},
"inputs":{
"multipliers":"[]",
"parallel":"false",
"continueOnError":"true"
}
}
],
"variables":{
"BuildConfiguration":{
"value":"debug",
"allowOverride":true
},
"BuildPlatform":{
"value":"any cpu",
"allowOverride":true
}
},
"retentionRules":[
{
"branches":[
"+refs/heads/*"
],
"artifacts":[
"build.SourceLabel"
],
"daysToKeep":10,
"deleteBuildRecord":true,
"deleteTestResults":true
}
],
"_links":{
"self":{
"href":"http://removed/343974ee-60a8-40ee-a103-37fa5db37c41/_apis/build/Definitions/71"
},
"web":{
"href":"http://removed/_permalink/_build/index?collectionId=808a695f-85b6-49db-a2df-ca4aaf8bbb9f&projectId=343974ee-60a8-40ee-a103-37fa5db37c41&definitionId=71"
}
},
"buildNumberFormat":"$(date:yyyyMMdd)$(rev:.r)",
"createdDate":"2015-11-19T07:43:27.977Z",
"jobAuthorizationScope":"projectCollection",
"jobTimeoutInMinutes":60,
"repository":{
"properties":{
"labelSources":"0",
"labelSourcesFormat":"$(build.buildNumber)",
"tfvcMapping":"{\"mappings\":[{\"serverPath\":\"$/IsdDev\",\"mappingType\":\"map\",\"localPath\":\"\\\\\"},{\"serverPath\":\"$/IsdDev/Drops\",\"mappingType\":\"cloak\",\"localPath\":\"\"}]}"
},
"id":"$/",
"type":"TfsVersionControl",
"name":"IsdDev",
"url":"http://removed/",
"defaultBranch":"$/IsdDev",
"rootFolder":"$/IsdDev",
"clean":"undefined",
"checkoutSubmodules":false
},
"quality":"definition",
"authoredBy":{
"id":"7d24caba-6c09-4b78-8ff1-2404e0b0ec64",
"displayName":"Rod Hall",
"uniqueName":"ISD-NR\\Rod.Hall",
"url":"http://removed/_apis/Identities/7d24caba-6c09-4b78-8ff1-2404e0b0ec64",
"imageUrl":"http://removed/_api/_common/identityImage?id=7d24caba-6c09-4b78-8ff1-2404e0b0ec64"
},
"queue":{
"pool":{
"id":2,
"name":"Back Office Pool"
},
"id":2,
"name":"Back Office Pool"
},
"uri":"vstfs:///Build/Definition/71",
"type":"build",
"revision":1,
"id":71,
"name":"SQ Test",
"url":"http://removed/343974ee-60a8-40ee-a103-37fa5db37c41/_apis/build/Definitions/71",
"project":{
"id":"343974ee-60a8-40ee-a103-37fa5db37c41",
"name":"IsdDev",
"url":"http://removed/_apis/projects/343974ee-60a8-40ee-a103-37fa5db37c41",
"state":"wellFormed",
"revision":7
}
}
What is the Build.Id that the warning refers to, how can I view it and set it?
This could even be a problem with TFS 2015 Update 1...
UPDATE I'm not sure if it matters but when I go to the Build section of the TFS Admin Console it appears to not be configured:
I have my application tier on 1 server and then I have 3 Agent Pools each with 3 Agents. There are 3 build servers each of which have 1 agent from each pool installed for a total of 9 agents. I set these up using PowerShell and I downloaded the agent from the TFS page. My builds still work Ok, it's just this tests publishing
Check the attached vNext build configuration, with which I can get the Test result and Code coverage. Make sure you have specified the solution in Visual Studio Build and select Code Coverage Enabled in Visual Studio Test.
Credit to Jesse Houwing for helping me on this one. I had to detach and reattach the Team Project Collection using the TFS Admin Console on the App Server. It seems there is an issue with Update 1 (or perhaps one of the Release Candidates).
For those with the same problem, it will obviously take TFS offline but it took less than 5 minutes.
I had a similar issue yesterday: Visual Studio Test using Test Agent step was failing with the "The value for the Build.Id property is not within the permissible values for it" error message when it was trying to execute Coded UI tests on the remote test machine. Detaching project collection and re-attaching it back fixed the issue.

Resources