Edit: The checks are successfully populated when run on: pull_request
When I set the event that triggers my workflow to
on:
pull_request
then the checks are automatically populated. I was running it with workflow_dispatch before.
Original question below
When running a GitHub Action workflow, each job that runs automatically publishes a check. I can verify this with the checks endpoint of the REST API
curl \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer TOKEN"\
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/OWNER/REPO/commits/REF/check-runs
This returns an object like
{
"total_count": 3,
"check_runs": [
{
"id": 9950586881,
"name": "deploy",
"status": "completed",
"conclusion": "success",
...
},
{
"id": 9950580659,
"name": "api-test",
"status": "completed",
"conclusion": "success",
...
},
{
"id": 9950580441,
"name": "ui-test",
"status": "completed",
"conclusion": "success",
...
},
]
}
I set these exact status checks ([deploy, ui-test, api-test]) as required passing before merging.
However, those status checks never get updated in the pull request UI (even though they are there in the REST API call...)
However, when I go to GitHub desktop, it shows that those status checks are there (and passing!)
For anyone else looking at this problem, I found that the workflow_dispatch event type was not sufficient to actually populate checks on the PR. Instead, I had to use the pull_request event type. Now it works.
Related
Using this Model Derivative endpoint we want to retrieve the properties of an object by calling it with its externalId. We follow the procedure explainined here.
The endpoint works using the objectid, in this case 3:
"data": {
"type": "properties",
"collection": [
{
"objectid": 3,
"name": "Finished Ceiling Height",
"externalId": "5d365ed4-cccc-4589-b4e1-a8c5c744672a-0046dd63",
"properties": {
"General": {
"Override": ""
},
"Extents": {
"Scope Box": "None"
},
"Constraints": {
"Elevation": "8.667 ft-and-fractional-in",
"Story Above": "Default"
},
"Dimensions": {
"Computation Height": "3.000 ft-and-fractional-in"
},
"Identity Data": {
"Name": "Finished Ceiling Height",
"Structural": "No",
"Building Story": "Yes",
"Asset ID": "",
"Asset Location": "",
"Asset Category": "",
"Workset": "Shared Views, Levels, Grids",
"Edited by": ""
}
}
}
]
}
}
The documentation states that we could also use externalId to get the same result.
The objectid of an object can change if the design is translated to SVF or SVF2 again. If you require a persistent ID to reference an object, use externalId.
But changing objectid=3 to objectid=5d365ed4-cccc-4589-b4e1-a8c5c744672a-0046dd63 returns an error 400:
{
"diagnostic": "Invalid 'objectid' parameter"
}
We also tried to convert the GUID to base64, use externalid instead of objectid as the parameter name. Everything with the same results.
Any ideas? Are we missunderstanding the documentation?
Note: Accesing the viewer is not an option at the moment, neither downloading the sqlite/json files
[Edit 1]
We tried setting the query parameter as externalId/externalid receiving the same results.
curl --location --request GET 'https://developer.api.autodesk.com/modelderivative/v2/designdata/urn/metadata/guid/properties?externalId=43f2c4e0-d09b-4151-a349-1b6f684411c6-004c8717' \
--header 'x-ads-force: true' \
--header 'x-ads-derivative-format: fallback' \
--header 'Authorization: Bearer XXXXXXX
The objectId parameter accepts numerical values only. As you can see from the API response, objectId is a numerical value. You cannot pass a string to this parameter, unfortunately.
However, our engineering team is working on the new property API which supports more filters. You might be interested in the new property metadata API mentioned in https://www.autodesk.com/autodesk-university/class/Forge-Road-Map-2021 at 20 mins.
I am using changes API to track my G-Drive changes, but it's not giving the complete resource data. Can I use 'watch' API to poll my resources?
Below is my request for changes API:
curl -X GET \
'https://www.googleapis.com/drive/v3/changes?pageToken=46' \
-H 'Accept: */*' \
-H 'Accept-Encoding: gzip, deflate' \
-H 'Authorization: Bearer <Token>' \
Here's the response:
"changes": [
{
"kind": "drive#change",
"type": "file",
"changeType": "file",
"time": "2019-10-10T09:15:12.313Z",
"removed": false,
"fileId": "<File_ID>",
"file": {
"kind": "drive#file",
"id": "<File_ID>",
"name": "shared",
"mimeType": "application/vnd.google-apps.folder"
}
}
]
But using this, I cannot decide the file is created or updated..
When you get a Changes resource, the response has a specific format.
You can see that the Changes has the property file that is of type Files.
What you want to do is inspect the Files resource returned by the change to monitor the state of the file between changes.
Hope this helps!
Recently some registrations of commands expired so I am trying to patch their "expires" attribute. However, I receive a 405 method not allowed message error.
Retrieving info about the registration:
curl -X GET \
http://localhost:1026/v2/registrations/5d3ff3e2ab1e270d7775a7bf \
-H 'Accept: application/json'
{
"id": "5d3ff3e2ab1e270d7775a7bf",
"expires": "2019-08-29T07:38:10.00Z",
"dataProvided": {
"entities": [
{
"id": "urn:ngsi-ld:ActuatorScreenshot:001",
"type": "Actuator"
}
],
"attrs": [
"Screen"
]
},
"provider": {
"http": {
"url": "http://localhost:4041"
},
"supportedForwardingMode": "all",
"legacyForwarding": true
},
"status": "active"
}
I attempted following the example from http://telefonicaid.github.io/fiware-orion/api/v2/stable/:
curl -X PATCH \
http://localhost:1026/v2/registrations/5d3ff3e2ab1e270d7775a7bf \
-d '{
"expires":"2040-10-04T00:00:00"
}'
But as I said I got the error message:
405 Method Not Allowed
Feel free to ask for more info.
The operation to modify registrations has not been yet implemented in Orion 2.2.0 (last version in the moment of writing this). As mentioned in Orion documentation:
Orion implements registration management as described in the NGSIv2
specification, except for the following aspects:
List item PATCH /v2/registration/<id> is not implemented. Thus, registrations cannot be updated directly. I.e., updates must be done
deleting and re-creating the registration. Please see this
issue about
this.
However, the workaround is pretty simple: delete the old registration and create a new one with the modified parameters.
I have made this subscription but it notifies always a attribute is changed.
curl --include \
--header 'Content-Type: application/json' \
--request POST \
--data-binary '{
"attrsFormat":"legacy",
"description": "Day subscription",
"subject": {
"entities": [
{
"idPattern": "es-leon-.*",
"type": "Event"
}
],
"condition": {
"attrs": [
"idEvent",
"Title",
"dFlag"
],
"expression": {
"q": "dFlag>0"
}
}
},
"notification": {
"http": {
"url" : "http://localhost:5050/notify"
},
"attrs": [
"idEvent",
"Title",
"dFlag"
]
}
}' \
'http://localhost:1026/v2/subscriptions'
I want that orion notify when any attribute described in the condition is changed AND the condition is satisfied.
Example I have in orion this entitys:
Concert1 (idEvent=Mozart, Title=Mconcert, dFlag=1)
Concert2 (idEvent=Salieri, Title=Sconcert, dFlag=0)
I want that when I made a change to any attribute of Concert1, as the condition is satisfied, it will notify.
In the case of Concert2, as the condition is not satisfied, it will not notify.
Is it posible? what I have wrong in this subscription example?
In the documentation do not said much:
condition: Condition that will trigger the notification. It can have
two optional properties:
attrs: array of attribute names
expression: an expression composed of q, georel, geometry and coords (see "List entities" operation above about this field).
List entities
q: A query expression, composed of a list of statements separated by ;, i.e. q=statement;statements;statement. See Simple Query Language specification. Example: temperature>40.
Version de orion: 1.1
This could be due to a problem in subscriptions cache management in Orion 1.1. So, the solution in that version is to disable cache using -noCache CLI option.
The bug has been identified (see this issue in github) and solved for Orion 1.2.
Would like to know how to authenticate to (for example):
http://www.example.com:8080/openam/UI/Login?realm=CUR&module=CURAuthn
preferably by POSTing JSON via REST over /json/authenticate.
I'm guessing it would be http://www.example.com:8080/openam/UI/Login?realm=CUR&authIndexType=module&authIndexValue=CURAuthn correct?
In any case this module doesn't take the standard X-OpenAM-Username or X-OpenAM-Password headers.
It takes a bunch of custom fields, called ID tokens. For instance it uses IDToken1, IDToken2, IDToken3, ...
How should I go about submitting the tokens to this plugin using the json authentication service? Thanks
All this is explained in the OpenAM's Developer's Guide section 3.4.
The REST URL for your custom module would be:
http://www.example.com:8080/openam/json/authenticate?authIndexType=module&authIndexValue=CURAuthn
If you module doesn't use the standard username/password credentials you'll have to pass your credentials in the request body as JSON.
You would start by sending a empty POST request to OpenAM:
$ curl \
--request POST \
--header "Content-Type: application/json" \
http://www.example.com:8080/openam/json/authenticate?authIndexType=module&authIndexValue=CURAuthn
You should get a response similar to this (based on your custom callbacks):
{
"authId": "eyAid...GDYaEQ",
"template": "",
"stage": "Module11",
"header": "Using CURAuthn",
"callbacks": [
{
"type": "NameCallback",
"output": [
{
"name": "prompt",
"value": "FirstCallback"
}
],
"input": [
{
"name": "IDToken1",
"value": ""
}
]
},
{
"type": "NameCallback",
"output": [
{
"name": "prompt",
"value": "SecondCallback"
}
],
"input": [
{
"name": "IDToken2",
"value": ""
}
]
},
//More callbacks here
]
}
After that just collect the credentials from the user input, fill in the empty values and submit the JSON payload back to the same URL. Make sure you use the same "authId" throughout the authentication process.
I wrote a blog post about custom authentication chains and how to communicate with them via REST. Take a look, it might be helpful.