Sap Commerce Cloud cannot generate build with custom addon - sap-commerce-cloud

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.

Related

How to fix graphql-tools/stitch stitched schemas returning null for aliased fields on union types?

The bug
Aliased attributes in union types resolve to null instead of their correct value when using schema stitching to combine two remote schemas.
The same query returns the correct result on the "non-stitched" schema when issued to the non-stitched schema at localhost:/4001/graphql
To Reproduce
Steps to reproduce the behavior:
checkout the github repo
follow the README.md steps:
npm i && npm run start
gateway on localhost:4444/graphql
remote-1 on localhost:4001/graphql
remote-2 on localhost:4002/graphql
go to localhost:4444/graphql (the stitched schema) and query
query {articles {title {
... on TitleOne {text}
... on TitleTwo {renamedText: text}
}}}
Expected behavior
result should contain correct values. E.g.
{
"data": {
"articles": [
{
"title": {
"text": "hello world"
}
},
{
"title": {
"renamedText": 1
}
},
{
"title": {
"renamedText": 2
}
},
{
"title": {
"text": "bye"
}
}
]
}
}
** Actual Behaviour **
result contains "null" for aliased fields
{
"data": {
"articles": [
{
"title": {
"text": "hello world"
}
},
{
"title": {
"renamedText": null
}
},
{
"title": {
"renamedText": null
}
},
{
"title": {
"text": "bye"
}
}
]
}
}
Environment:
OS: ubuntu 18.04
"#graphql-tools/load": "^7.5.8",
"#graphql-tools/schema": "^8.3.8",
"#graphql-tools/stitch": "^8.6.6",
"#graphql-tools/url-loader": "^7.9.11",
"#graphql-tools/wrap": "^8.4.13",
NodeJS: v14.19.1
Does anyone know how I can get this to return the correct values instead of "null"?

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"
},

gatsby custom source plugin - need help to get all the data

I am working on my first custom source plugin for gatsby, but I am stuck now..
Its working so far that I get the data I need create node, but not for all the data.
the response i get from the api looks like this
{
"section1": {
"date": "...",
"moreinformartion": "...",
},
"section2": [
{
"sub1": {
"information": "..."
}
},
{
"sub2": {
"information": "..."
}
},
{
"sub2": {
"information": "..."
}
}
]
}
But with all the tutorials out there, I was "only" able to get a node for every sub in section2
result.data.roster.forEach(data => {
const node = {
...data,
id: createNodeId(`KILL-setup-${data.character.name}`),
internal: {
type: 'KILLSetup',
contentDigest: createContentDigest(data)
}
};
actions.createNode(node);
});
How can I get 1 node, with all the data inside?

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"
},
...
]
}
}
}
}
...

Can't get cn from Policy Response of OpenAM

All.
I’m trying to config OpenAM, J2EEAgent and OpenIG. I want to get cn when I get Policy Response of OpenAM. so I config com.sun.identity.agents.config.response.attribute.fetch.mode
= HTTP_HEADER. However I can’t get cn in the Policy Response.
I have two questions.
1, How do I configure to get cn in the Policy Response?
2, I search uid(OpenIG managed) from cn using SqlAttributesFilter
when OpenIG get the Policy Response. I made config.json of OpenIG. Please check it.
{
"_comment" : "Sample OpenIG config for form login.",
"heap":[
{
"name":"DispatchHandler",
"type":"DispatchHandler",
"config":{
"bindings":[
{
"condition": "${matches(exchange.request.uri.path,'^/openig') != null}",
"handler":"LoginChain"
},
{
"handler":"OutgoingChain"
}
],
"baseURI":"http://test.co.jp:7070/"
}
},
{
"name":"LoginChain",
"type":"Chain",
"config":{
"filters":["SqlAttributesFilter"],
"handler":"LoginRedirectHandler"
}
},
{
"name": "SqlAttributesFilter",
"type": "SqlAttributesFilter",
"config": {
"dataSource": "java:comp/env/jdbc/postgresql",
"preparedStatement":
"SELECT uid
FROM user_table WHERE cn = ?;",
"parameters": [
"${exchange.request.headers['cn'][0]}"
],
"target" : "${exchange.credentials}"
}
},
{
"name":"LoginRedirectHandler",
"type":"StaticResponseHandler",
"config":{
"status":302,
"reason":"Found",
"headers":{
"Location":[
"http://test.co.jp:5050/testsp/index.html?j_site=${exchange.credentials.site}&j_uid=${exchange.credentials.uid}"
],
"Cache-Control":["no-cache"],
"Pragma":["no-cache"]
}
}
},
{
"name":"OutgoingChain",
"type":"Chain",
"config":{
"filters":[
"CaptureFilter"
],
"handler":"ClientHandler"
}
},
{
"name":"ClientHandler",
"type":"ClientHandler",
"config":{
}
},
{
"name":"CaptureFilter",
"type":"CaptureFilter",
"config":{
"captureEntity":true,
"file":"/home/test/.openig/config/gateway.log"
}
},
{
"name":"LogSink",
"comment":"Default sink for logging information.",
"type":"ConsoleLogSink",
"config":{
"level":"DEBUG"
}
}
],
"handler": "DispatchHandler"
}
Please give me your help.
Regard.
1) by modifying the policy that suppose to match your protected resource, and adding "cn" to the list of attributes.
Alternatively you could just modify your agent configuration, so instead of using response attributes, you set up attribute mapping for profile attributes.

Resources