Google Cloud-Builder how to build all branches except for master - google-container-registry

I want to be able to build all branches that are not master, however when I try ^((?!master).)*$ the UI correctly shows all non-master branches but saving returns a HTTP 400 error.
{
"error": {
"code": 400,
"message": "trigger_template branch_name is not a valid regular expression",
"status": "INVALID_ARGUMENT"
}
}

this is stupid ... but works by ignoring everything that starts with "master"
^(?:[^m]|m[^a]|ma[^s]|mas[^t]|mast[^e]|maste[^r]|master.)

The regex used must be compatible with Go's regex library, which this one is not. (It is compatible with JavaScript, which is why the UI works with it.) https://regex101.com/ is useful for playing with different language parsers. (A teammate just showed it to me.) Go's regex documentation is on GitHub.

Related

Google Document AI training fails due to an error that is already addressed

I am training a model using Google's Document AI. The training fails with the following error (I have included only a part of the JSON file for simplicity but the error is identical for all documents in my dataset):
"trainingDatasetValidation": {
"documentErrors": [
{
"code": 3,
"message": "Invalid document.",
"details": [
{
"#type": "type.googleapis.com/google.rpc.ErrorInfo",
"reason": "INVALID_DOCUMENT",
"domain": "documentai.googleapis.com",
"metadata": {
"num_fields": "0",
"num_fields_needed": "1",
"document": "5e88c5e4cc05ddb8.json",
"annotation_name": "INCOME_ADJUSTMENTS",
"field_name": "entities.text_anchor.text_segments"
}
}
]
}
What I understand from this error is that the model expects the field INCOME_ADJUSTMENTS to appear (at least) once in the document but instead, it finds zero instances of it.
That would have been understandable except I have already defined the field INCOME_ADJUSTMENTS in my schema as "Optional Once", i.e., this field can appear either zero or one time.
Am I missing something? Why does this error persist despite the fact that it is addressed in the schema?
p.s. I have also tried "Optional multiple" (and "Required once" and "Required multiple") and the error persists.
EDIT: As requested, here's what one of the JSON files looks like. Note that there is no PII here as the details (name, SSN, etc.) are synthetic data.
I have/had the same issue as you in the past and also having it right now.
What I managed to do was to get the document string from the error message and then searching for the images in the Storage bucket that has the dataset.
Then I opened the image and searched for that image in my 1000+ images dataset.
Then I deleted the bounding box for the label with the issue and then relabeled it. This seemed to solve 90%of the issues I had.
It`s a ton of manual work and I wish google thought of more when they released the Web app for Doc AI because the ML part is great but the app is really lackluster.
I would also be very happy for any other fixes
EDIT: another quicker workaround I have found is deleting the latest revision of the labeled documents from the Dataset in cloud storage. Like, take faulty document name from the operation json dump, then search for it in documents/ and then just delete latest revision.
Will probably mess up labeling and make you lose work, but it`s a quick fix to at least make some progress if you want.
Removed a few empty boxes and a lot of intersecting boxes fixed it for me.
i had the same problem.
so i deleted all my dataset and imported and re-labeled again.
then the training worked fine.

How do you perform an exact string match using GS API v7?

I need to be able to look up a location based on an exact city, state, and country triplet.
HERE's Geocoder v6.2 API supports exact matching out of the box, however that API is in maintenance mode and I would prefer to be on the latest and greatest given I'm starting a project from scratch.
Here's some examples: You can hit the Geocoder v6.2 API with a request including a fake city and get the correct response (no results):
https://geocoder.ls.hereapi.com/6.2/geocode.json?apiKey=...&country=USA&state=TX&city=Faketown
{
"Response": {
"MetaInfo": {
"Timestamp": "2021-02-12T01:53:40.367+0000"
},
"View": []
}
}
but what I believe is an equivalent request to the GS v7.0 API returns incorrect results when using the "qualified query" syntax:
https://geocode.search.hereapi.com/v1/geocode?apiKey=...&qq=country=USA;state=TX;city=Faketown
{
"items": [
{
"title": "Laketown, UT, United States",
"id": "here:cm:namedplace:21035617",
"resultType": "locality",
(Wrong city, wrong state, correct country).
What do you need to do to get the v7 API (geocode or otherwise) to use exact matching and thus return zero results for this request? Or should I use the Geocoder v6.2 API for this instead?
Geocoder v7 API Documentation states the following information.
The /geocode endpoint is used to find the geo-coordinates of a known address, place, locality or administrative area, even if the query is incomplete or partly incorrect. It also returns a complete postal address string and address details.
This is the reason behind the behavior, you can check the following link for more information.
https://developer.here.com/documentation/geocoding-search-api/dev_guide/topics/endpoint-geocode-brief.html
We can recommend you to opt for /Autocomplete which provides completion of the entered keystrokes to the valid addresses, where no spell correction is included.
For more information you can check the following link.
https://developer.here.com/documentation/geocoding-search-api/dev_guide/topics-api/code-autocomplete-examples.html
For hands on experience you can also check the following link.
https://tcs.ext.here.com/examples/v3/admin_boundaries_batch

How do I find out where the response from dialogflow comes from?

I'm not a developer, so this is a little above my head.
My team has implemented a project in dialogflow, one for an old app and one from a new app. I have basic access to the old dialogflow account and I can see that it has an intent called glossaries, same intent name as in the new one. In glossaries, there is a training phrase called "What is a red talk?". This phrase only works in one of my apps and I need to know why.
There is no default response or anything under context. If I copy that curl link into a terminal, the payload doesn't return with any information.
I found the API for the new app and red talks is definitely not in the payload when I do a GET/all. There may be an old API somewhere, but no one knows where.
Where can I find this information? I'm very confused and all the basic training for dialogflow points to default response, which we're not using. I have read through the docs. I have searched the three company github repos that have the application in the name but I have not found anything. I am looking for an app.intent phrase with glossaries in it or just the word glossaries.
I have found only this json and a glossaryTest.php that doesn't seem helpful:
"meta": {
"total": 2,
"page": 1,
"limit": 10,
"sort": "createdAt",
"direction": "desc",
"load-more": false
},
"results": [
{
"term": "This is a term",
"definition": "This is a definition",
"links": [
{
"id": "1",
"url": "http:\/\/example.com\/1",
"title": "KWU Course: Lead Generation 36:12:3",
"ordering": "1"
},
{
"id": "2",
"url": "http:\/\/example.com\/2",
"title": "",
"ordering": "2"
}
]
}
]
}
There is also a json with a lot data for API calls but no glossaries there either.
If we're using fulfillment to handle these intents, I don't see a fullfillment header like google docs say there should be. I may not have full access so perhaps I would be viewing more information in the screen if I had that, I have no idea. The devs who created this are long gone. The devs who also created the new app are also long gone.
Am I missing an API in my environment documentation? Is the intent hard coded? I suspect it was. How do I prove that or move forward?
Yes, your intent are somehow hard-coded [0], or defined through the UI.
Each intent has a setting to enable fulfillment. If an intent requires
some action by your system or a dynamic response, you should enable
fulfillment for the intent. If an intent without fulfillment enabled
is matched, Dialogflow uses the static response you defined for the
intent. [2]
Perhaps you are using a custom integration [1]. So, unless you are using static response (those you see in the UI), the frontend code may be managed by your project API (not Dialogflow API), and perhaps the content modified before performing any further or eventually returning the response.
As I understand you should contact your colleagues for understanding about the integration solution they have created. Or otherwise if the Intent has been created through the API, look for its relative files where there may be They may have created the integration through the SDK, while picking up training data from a source out of the codebase. So perhaps you cannot see it directly in the code. Nonetheless, you should be able to access it through the UI once it has been created.
In case my answer was not of your help, please do not hesitate to further clarify your needs, perhaps providing some further information.
[0] https://cloud.google.com/dialogflow/docs/manage-intents#create_intent
[1] https://cloud.google.com/dialogflow/docs/integrations
[2] https://cloud.google.com/dialogflow/docs/fulfillment-overview

Azure Cosmos DB - Gremlin latitude longitude format conversion issues

I am trying to convert airport GeoCoordinate data i.e. [IATA Code, latitude, longitude] to Gremlin Vertex in an Azure Cosmos DB Graph API project.
Vertex conversion is mainly done through an Asp.Net Core 2.0 console application using CSVReader to stream and convert data from a airport.dat (csv) file.
This process involves converting over 6,000 lines...
So for example, in original airport.dat source file, the Montreal Pierre Elliott Trudeau International Airport would be listed using a similar model as below:
1,"Montreal / Pierre Elliott Trudeau International Airport","Montreal","Canada","YUL","CYUL",45.4706001282,-73.7407989502,118,-5,"A","America/Toronto","airport","OurAirports"
Then if I define a Gremlin Vertex creation query in my cod as followed:
var gremlinQuery = $"g.addV('airport').property('id', \"{code}\").property('latitude', {lat}).property('longitude', {lng})";
then when the console application is launched, the Vertex conversion process would be generated successfully in exact similar fashion:
1 g.addV('airport').property('id', "YUL").property('latitude', 45.4706001282).property('longitude', -73.7407989502)
Note that in the case of Montreal Airport (which is located in N.A not in the Far East...), the longitude is properly formatted with minus (-) prefix, though this seems to be lost underway when doing a query on Azure Portal.
{
"id": "YUL",
"label": "airport",
"type": "vertex",
"properties": {
"latitude": [
{
"id": "13a30a4f-42cc-4413-b201-11efe7fa4dbb",
"value": 45.4706001282
}
],
"longitude": [
{
"id": "74554911-07e5-4766-935a-571eedc21ca3",
"value": 73.7407989502 <---- //Should be displayed as -73.7407989502
}
]
}
This is a bit awkward. If anyone has encountered a similar issue and was able to fix it, then I'm fully open to suggestion.
Thanks
According to your description, I just executed Gremlin query on my side and I could retrieve the inserted Vertex as follows:
Then, I just queried on Azure Portal and retrieved the record as follows:
Per my understanding, you need to check the execution of your code and verify the response of your query to narrow down this issue.
Thank you for your suggestion, though problem has now been solved in my case.
What was previously suggested as a working answer scenario [and voted 1...] has long been settled in case of .Net 4.5.2 [& .Net 4.6.1] version used in combination with Microsoft.Azure.Graph 0.2.4 -preview. The issue of my question didn't really concern that and may have been a bit more subtle... Perhaps I should have put a bit more emphasis on the fact that the issue was mainly related to Microsoft.Azure.Graph 0.3.1 -preview used in Core 2.0 + dotnet CLI scenario.
According to following Graph - Multiple issues with parsing of numeric constants in the graph gremlin query #438 comments on Github,
https://github.com/Azure/azure-documentdb-dotnet/issues/438
there are indeed some fair reasons to believe that the issue was a bug with Microsoft.Azure.Graph 0.3.1 -preview. I chose to use Gremlin.Net approach instead and managed to get the proper result I expected.

where is the contacts.json file for ember examples

I've downloaded the samples for ember.js and followed the directions to start the contact example via node and localhost:3000 But, there's no contacts.json file that I can find so nothing loads. Clicking New Contact does nothing. I'm not quite sure how to troubleshoot this but I'm wondering if it has to do with no contacts.json file being present when according to the description there should be.
Unfortunately, the Ember examples appear to be a little out-of-date at the moment (the contacts demo still references the SC namespace last I checked) and some may be broken. I suspect that once Ember 1.0 is released this will get cleaned up. You can view issues for emberjs/examples on github.
I don't think your problem is because of the missing contacts.json file because it's broken on the live contacts demo too--console shows:
Failed to load resource: the server responded with a status of 404 (Not Found)
You can comment-out the parts of the contacts example that load the JSON data to make that error go away, e.g.,
//App.contactsController.loadContacts();
or you could create a new JSON file, e.g.,
[
{
"firstName": "Alice",
"lastName": "Anderson",
"phoneNumbers": [
"+1 123-456-7890"
]
},
{
"firstName": "José",
"lastName": "Zulu",
"phoneNumbers": [
"+55 (11) 5000-6000"
]
}
]
However, it might be better not to base your education on the examples right now. Check out the reference documentation and some of the good articles for getting started instead. I found trek's article: Advice on & Instruction in the Use Of Ember.js to be helpful.