Renovate config "automerge" could not work - package.json

I use Renovate for update package.json
refs:
Renovate Docs \| Renovate Docs
This is my renovate.json file, but patch directive is not work, I must merge it manually now. (schedule directive is work)
{
"extends": ["config:base"],
"timezone": "Asia/Tokyo",
"schedule": ["every weekend"],
"patch": { "automerge": true }
}
I should set like below?
{
"automerge": true,
"major": { "automerge": false },
"minor": { "automerge": false }
}

You have to specify which types of updates you want to auto-merge. This is the example from the docs:
{
"packageRules": [
{
"updateTypes": ["minor", "patch", "pin", "digest"],
"automerge": true
}
]
}
Example from: https://docs.renovatebot.com/configuration-options/#automerge
So your config should look like:
{
"extends": ["config:base"],
"timezone": "Asia/Tokyo",
"schedule": ["every weekend"],
"packageRules": [
{
"updateTypes": ["patch", "pin", "digest"],
"automerge": true
}
]
}

Related

Sap Commerce Cloud cannot generate build with custom addon

I've installed in my local environment customgigyaaddon (an extended version of gigyaloginaddon), injected in my customstorefront and added to localextensions.xml and compiled without any problems, however, when I try to generate a build of this same version in sap commerce cloud, it throws me the following exception :
/opt/workspace/build/commerce-
suite/hybris/bin/platform/resources/ant/antmacros.xml:587:
java.lang.IllegalArgumentException: cannot merge namespace ((customgigyaaddon)) into
((<merged>)) due to duplicate type code 'gigyaconfig2cmssite' : GigyaConfig2CMSSite::
((customgigyaaddon))::YRelation[customgigyaaddon-items.xml:14(RelationTypeTagListener)]
<>GigyaConfig2CMSSite::((gigyaservices))::YRelation[gigyaservices-
items.xml:65(RelationTypeTagListener)]
My localextensions-cloud.xml is exactly the same as my localextensions.xml and in the manifest.json I've declared the addon injection as follows:
{
"commerceSuiteVersion":"2105",
"enableImageProcessingService": true,
"extensionPacks" : [
{
"name" : "hybris-commerce-integrations",
"version" : "2108.2"
}
],
"extensions":[
"sapymktcommon",
"sapymktclickstream",
"sapymktrecommendation",
"sapymktrecommendationbuffer",
"sapymktrecommendationwebservices",
"cloudmediaconversion",
"mediaconversionbackoffice",
"sapymktsegmentation",
"sapymktsegmentationb2b",
"sapymktsegmentationwebservices",
"personalizationymkt",
"integrationbackoffice",
"outboundsyncbackoffice",
"sapymktdatareplication",
"assistedservicestorefront"
],
"useConfig":{
"properties":[
{
"location":"config/local-dev.properties",
"persona":"development"
},
{
"location":"config/local-stag.properties",
"persona":"staging"
},
{
"location":"config/local-prd.properties",
"persona":"production"
}
],
"extensions":{
"location":"/config/localextensions-cloud.xml"
},
"solr":{
"location":"customSolr"
}
},
"storefrontAddons":[
{
"addons":["commerceorgsamplesaddon","smarteditaddon","textfieldconfiguratortemplateaddon","customerticketingaddon","orderselfserviceaddon","consignmenttrackingaddon","marketplaceaddon","notificationaddon","customerinterestsaddon","stocknotificationaddon","customaddon","configurablebundleaddon","sapymktrecommendationaddon"],
"storefronts":["customstorefront"],
"template":"yacceleratorstorefront"
},
{
"addons":["customgigyaaddon"],
"storefronts":["customstorefront"],
"template":"yacceleratorstorefront"
}
],
"aspects":[
{
"name":"backoffice",
"webapps":[
{
"name":"mediaweb",
"contextPath":"/medias"
},
{
"name":"backoffice",
"contextPath":"/backoffice"
},
{
"name":"hac",
"contextPath":"/hac"
},
{
"name":"dathubadapter",
"contextPath":"/datahubadapter"
},
{
"name":"oauth2",
"contextPath":"/authorizationserver"
},
{
"name": "customstorefront",
"contextPath": "/valet"
}
{
"name": "personalizationsmartedit",
"contextPath": "/personalizationsmartedit"
},
{
"name": "personalizationpromotionssmartedit",
"contextPath": "/personalizationpromotionssmartedit"
},
{
"name": "personalizationwebservices",
"contextPath": "/personalizationwebservices"
},
{
"name": "personalizationsearchsmartedit",
"contextPath": "/personalizationsearchsmartedit"
},
{
"name":"previewwebservices",
"contextPath":"/previewwebservices"
},
{
"name":"permissionswebservices",
"contextPath":"/permissionswebservices"
},
{
"name":"ycommercewebservices",
"contextPath":"/rest"
}
]
}
],
"webapps":[
{
"name":"customstorefront",
"contextPath":"/custom"
}
]
},
{
"name":"backgroundProcessing",
"properties":[
{
"key":"cluster.node.groups",
"value":"integration,yHotfolderCandidate"
}
],
"webapps":[
{
"name":"hac",
"contextPath":"/hac"
},
{
"name":"mediaweb",
"contextPath":"/medias"
}
]
}
]
}
],
"properties": [
{
"key":"configFile",
"value":"/opt/hybris/bin/custom/resources/update-config.json"
}
]
}
Looking the exception it looks like there is already an relation gigyaconfig2cmssite declared in gigyaservices-items.xml, however this is not true since this specific relation is only declared in customgigyaservices-items.xml.
Am I missing something? I feel really lost
if you analyzed the issue as follows:customgigyaaddon-items.xml and gigyaservices-items.xml, both contain the entry.
Otherwise, have you tried to ant clean all the platform? Also, set generate and auto-create as false and removed the extends.

How to use filter expressions on aws using python3 for nested map attribute?

I have been trying to scan DynamoDB to check for particular value in a nested map attribute named deliverables. However using scan with filter expressions is resulting in an empty result.
import boto3
result = []
dynamo_client = boto3.client("dynamodb")
paginator = dynamo_client.get_paginator("scan")
operation_parameters = {
'FilterExpression': "#Deliverable= :deliverable",
'ExpressionAttributeNames': {
'#Deliverable': 'deliverables.fc986523-a666-478e-8303-2a1c3c1dc4ba'
},
'ExpressionAttributeValues': {
':deliverable': {
"M": {
"read": {
"BOOL": True
},
"upload": {
"BOOL": True
},
"write": {
"BOOL": True
}
}
}
}
}
for page in paginator.paginate(TableName="TableName", **operation_parameters):
result.append(page["Items"])
print(result)
The items in the dynamo db look like this:
[
[
{
"deliverables":{
"M":{
"7397d832-fefb-4ba2-97a1-0f6e73d611d9":{
"M":{
"read":{
"BOOL":true
},
"upload":{
"BOOL":true
},
"write":{
"BOOL":true
}
}
},
"fc986523-a666-478e-8303-2a1c3c1dc4ba":{
"M":{
"read":{
"BOOL":true
},
"upload":{
"BOOL":true
},
"write":{
"BOOL":true
}
}
}
}
},
"username":{
"S":"username1"
},
"deniedReferences":{
"L":[
]
}
},
{
"deliverables":{
"M":{
"7397d832-fefb-4ba2-97a1-0f6e73d611d9":{
"M":{
"read":{
"BOOL":true
},
"upload":{
"BOOL":false
},
"write":{
"BOOL":false
}
}
},
"fc986523-a666-478e-8303-2a1c3c1dc4ba":{
"M":{
"read":{
"BOOL":true
},
"upload":{
"BOOL":false
},
"write":{
"BOOL":false
}
}
}
}
},
"username":{
"S":"repositoryadmin"
},
"deniedReferences":{
"L":[
]
}
}
]
]
Please let me know if you can help me solve this issue.
The problem is the [dot] here: 'ExpressionAttributeNames': { '#Deliverable': 'deliverables.fc986523-a666-478e-8303-2a1c3c1dc4ba'}
Expressions docs: DynamoDB interprets a dot in an expression attribute name as a character within an attribute's name.
operation_parameters = {
"FilterExpression": "#D0.#D1=:deliverable", # the dot goes here!
"ExpressionAttributeNames": {
"#D0": "deliverables",
"#D1": "fc986523-a666-478e-8303-2a1c3c1dc4ba"
},

JSON Transform Only Returning 1st Item in JSON Object

I am using object-mapper to transform a JSON object to a different JSON format. The following works... but only produces the first entry in the JSON I have. Is there some sort of foreach or iteration that needs to be added?
This:
var src = response.data;
var map = {
"value.segments.start": "value.start",
"value.segments.end": "value.end",
"value.segments.segments.performanceCounters/processCpuPercentage.avg": "value.cpu"
};
var dest = objectMapper(src, map);
res.send(dest);
Produces this:
{
"value": {
"start": "2021-04-15T00:00:00.000Z",
"end": "2021-04-16T00:00:00.000Z",
"cpu": 9.01
}
}
But here is my response.data as I get JSON from one source and need to transform it to another format, as you can see multiple entries and I expected to multiple entries in the object-mapped output:
{
"value": {
"start": "2021-04-14T18:17:27.086Z",
"end": "2021-04-15T18:17:27.086Z",
"interval": "PT1H",
"segments": [
{
"start": "2021-04-14T18:17:27.086Z",
"end": "2021-04-14T19:00:00.000Z",
"segments": [
{
"performanceCounters/processCpuPercentage": {
"avg": 22.9
},
"customDimensions/Role": "CD"
}
]
},
{
"start": "2021-04-14T19:00:00.000Z",
"end": "2021-04-14T20:00:00.000Z",
"segments": [
{
"performanceCounters/processCpuPercentage": {
"avg": 23.51
},
"customDimensions/Role": "CD"
}
]
},
{
"start": "2021-04-15T00:00:00.000Z",
"end": "2021-04-15T01:00:00.000Z",
"segments": [
{
"performanceCounters/processCpuPercentage": {
"avg": 8.85
},
"customDimensions/Role": "CD"
}
]
},
It looks like objectMapper is just for Objects, not arrays of objects. You should have luck with the following:
var src = response.data;
var map = {
"value.segments.start": "value.start",
"value.segments.end": "value.end",
"value.segments.segments.performanceCounters/processCpuPercentage.avg": "value.cpu"
};
var dest = src.map(s => objectMapper(s, map) );
res.send(dest);

Nodejs: Invalid or unexpected token while using decorators typescript

I'm was using type-graphql to create a simple API. So I created a simple query which is working fine before.
#Resolver()
class B {
#Query({nullable: true})
async a(#Arg("b", () => String) b: string) {
}
}
But when I integrated babel in my project it's start throwing this error:
/Users/robot/Desktop/node-test/src/index.ts:37
var _a = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(#(0, _typeGraphql.Arg)("b", function () {
^
SyntaxError: Invalid or unexpected token
.babelrc:
{
"presets": [
"#babel/preset-env",
"#babel/preset-typescript"],
"plugins": [
["#babel/plugin-proposal-decorators", {"legacy": true}],
"#babel/plugin-proposal-class-properties",
"#babel/plugin-transform-typescript",
"#babel/plugin-transform-runtime"
]
}
Try removing {"legacy": true} from your .babelrc unless you are sure that you need it. If you do need it, using {"legacy": true} with #babel/plugin-proposal-decorators needs some additional configuration according to https://babeljs.io/docs/en/babel-plugin-proposal-decorators#legacy :
When using the legacy: true mode, the setPublicClassFields assumption must be enabled to support the #babel/plugin-proposal-decorators.
The example configuration they give is
{
"assumptions": {
"setPublicClassFields": true
},
"plugins": [
["#babel/plugin-proposal-decorators", { "legacy": true }],
["#babel/plugin-proposal-class-properties"]
]
}
Applying that to example to your .babelrc would change it to the following. Does that solve your issue?
{
"assumptions": {
"setPublicClassFields": true
},
"presets": [
"#babel/preset-env",
"#babel/preset-typescript"],
"plugins": [
["#babel/plugin-proposal-decorators", {"legacy": true}],
"#babel/plugin-proposal-class-properties",
"#babel/plugin-transform-typescript",
"#babel/plugin-transform-runtime"
]
}

How can we list all the branches in a repo using github graphQL api?

I am trying to check if a branch already exists in repo for that first I need to get all the open branches present.
query searhbranches {
repositoryOwner(login: "username"){
repository(name: "config-replica"){
name
[branches] // something like this but its not available
}
}
}
You want to look at the refs node inside repository. Here's an example query that works for me:
{
repository(owner: "desktop", name: "desktop") {
refs(first: 50, refPrefix:"refs/heads/") {
nodes {
name
}
}
}
}
This is what it returns:
{
"data": {
"repository": {
"refs": {
"nodes": [
{
"name": "add-lfs-path-lookup"
},
{
"name": "add-notes-lookup-to-parser"
},
{
"name": "ahead-behind-toggle-spike"
},
{
"name": "all-stash-functions"
},
...
]
}
}
}
}
...

Resources