Using 'only' directive with AND condition - gitlab-ci

How do I run a job only when say, its a branch, AND tagged? Something like
only
- branches
- /^staging-/

Assuming you have a branch called feature-1 and your question is how do I match only tags that are called staging-* this is your only block:
only
- tags
- /^staging-/
If you want to target only tags based on certain branches that seems not possible at this time. Only when you have a naming convention like above. Since Gitlab cannot determine what branch a certain tag was based on.

Related

How to handle delete booking webtours in jmeter?

How to handle the remove flight booking in webtours? It came to my mind that if I wanna run the test with 3 virtual users and how they supposed to delete the booking if the information down here (refer below) are unique for each virtual user? Does any of these variables below need to be parameterized or need to apply correlation?
If there are multiple flight id to be deleted, we can create a CSV file having those ids
and use a while loop controller to delete each of them.
You may refer -
https://guide.blazemeter.com/hc/en-us/articles/206733689-Using-CSV-DATA-SET-CONFIG
https://www.blazemeter.com/blog/using-while-controller-jmeter
As you said, it will differ for a different user, you can store each value from the response of each user(extract value using regex) and pass them in delete call.
reference link - https://guide.blazemeter.com/hc/en-us/articles/207421325-Using-RegEx-Regular-Expression-Extractor-with-JMeter-Using-RegEx-(Regular-Expression-Extractor)-with-JMeter
I don't know what "webtours" is, however there is one "golden" rule: each and every parameter which is dynamic needs to be correlated.
If you don't have any idea regarding which ones are dynamic - record the same action one more time using JMeter's HTTP(S) Test Script Recorder and compare the generated requests, parameter values (or even names) which differ needs to be correlated.
Another approach is to inspect the previous response(s) using View Results Tree listener and look if the data is present there
Check out Advanced Load Testing Scenarios with JMeter: Part 1 - Correlations article for more information and example implementation

AWS XRay regex servicename filter

I have services for different git branches. And would like to have Service Map drawn for each branch separately.
For this I need to create a Group for each branch (provide some filtering condition that will match only traces corresponding to the branch I want).
My services have branch specified in their names. E.g. UserService-BRANCH_NAME
Is there a way to filter out all services that have name that contains some text?
There is CONTAINS filter in Xray console documentation, but it is not applied for service names.
https://docs.aws.amazon.com/xray/latest/devguide/xray-console-filters.html
It is possible to do what you are saying but instead of doing it as part of service name I would do a separate annotation. Segments in your traces can have annotations which are essentially key value pairs containing extra information about your traces which you can layer filter on. You can create an annotation say branch_name in your traces and then create a group for each branch with filter annotation.branch_name =.... You can also do contains instead of = if you want.

managing (electrical) components

I was searching for an application to manage (electrical) components that complies with the following criteria:
- open source
- has a purchase-history
- allows filtering for type-specific attributes (abstract example: two categories A, B exist; following attributes belong to them: A.a, B.b, A.c, B.c; when choosing one category it should be possible to filter for those category specific attributes a or b)
- must: linux, optional platform-independant
Here is an extraordinary example: http://uk.farnell.com/
And with a sample-search: filters applied
I didn't find a program that meets the criteria and so tried to build a webapplication myself.The problems arose when trying to find a database-layout.
Here some thoughts:
-> use a table for each category, subcategory, sub-subcategory, ...
-> the most specific subcategory for a part has a reference to this part (that is in a part table)
I could not figure out if/how it is possible then to dynamically add new categories without changing all the SQL queries.
My idea was then to have a name-schema that allows me to write some code that analyzes those names and creates the query on the fly but that feels quite hacky.
Maybe someone has a reference to a database example or some tips?
(further information can be found in the edit-history, i deleted it because it blows up the post too much)

How do you query multiple asset types using Version One rest API?

I would like to get the story name and number from querying tasks by owner. I am wondering if this is possible in a single query or if I will have to first query for the specific task and then look up the story using the task identifier in two separate queries.
Input: Task.Owners.Name
Output: Story.Name,Story.Number
Task Attributes
*Owners.Name
*TaskID
Story Attributes
*TaskID
*Name
*Number
I am able to call the REST api like below:
rest-1.v1/Data/Task?where=Task.Owners.Name='{{ownerName}}'&sel=Task.Owners.Name,Task.Number,Parent
Is there a way to query the Story endpoint with only task attributes specified in the where condition?
Is there a way to query the Story endpoint with only task attributes
specified in the where condition?
I am starting from the Story endpoint, iterating through all Stories filtering by the Tasks that belong to the current Story, and filtering by the Task's Owners attribute.
/rest-1.v1/Data/Story?sel=Number,Children:Task[Owners.Name='pinky']&where=Children:Task[Owners.Name='pinky']
(1) sel=Children:Task[Owners.Name='pinky']- The Children multi-relation returns all children of a Story which are Tests and Tasks. I used downcasting to filter down to only Tasks.
(2) Inside of the [ ], is where you can add a specific filter to the data return from Children:Task.
(3) #where=Children:Task[Owners.Name='pinky'] is a way to filter out items that have empty elements. Experiment with it by removing it and see the difference in output.

Cross-project time-record filtering using Active Collab 5 API

For Active Collab team watching this tag.
I am working on a project that uses new Active Collab 5 API, I am having performance issue trying to run reports.
Example I try to build reports on date-range, and currently to achieve that I need to first run a call to get all projects.
Followed by a loop with this call:
API::get('/projects/'.$id.'/time-records/filtered-by-date?' . http_build_query(['from' => $from, 'to' => $to]))
However we have a large number of projects, in addition to high number of active projects we also need to filter Archived projects as well to get correct reports for billing.
Now I work with around 1500 projects in AC.
So I need to make 1500 API calls which takes a huge performance hit. Is there a way that you can possibly build something that would work along these lines.
API::get(/timerecords/filter-by-date);
with a possible passed parameter that will say (all, active, complited) project state.
Please let me know what you can do or if I have missed something in your documentation that already does this.
Thanks
What you need here is not a request that goes through all projects one by one, but a request that it tailored for cross-project reporting. Active Collab 5 has just the right API endpoint for that - /reports/run.
As an example, you can use this command to query time records and expenses from all active projects that were tracked today:
curl -H "X-Angie-AuthApiToken: YOUR-API-TOKEN" "http://your.activecollab.com/api/v1/reports/run?type=TrackingFilter&project_filter=active&tracked_on_filter=today"
Notice the route (/reports/run) and query arguments:
type - specify type of the report, in this case time and expense tracking report,
project_filter - specify project filter. Apart from active, other useful values of this filter are completed (for completed projects), selected_1,2,3,4 (selected projects with a list of project ID-s), client_1,2,3,4 (projects for clients with the given ID-s), category_1,2,3,4 (projects in categories with the given ID-s),
tracked_on_filter - filter by the date when records were tracked. To target a particular date use selected_date_YYYY-MM-DD and to target a date range use selected_range_YYYY-MM-DD:YYYY-MM-DD.
tracked_by_filter - filter by who tracked the time. It can have various values, like anybody, logged_user, selected_1,2,3.
To list only time records, set type_filter to time (or to expenses if you want only expenses to be listed).