Using the rally-node toolkit, I'm getting an error message returned when attempting to add new Changeset, with new Changes inline, to an existing Userstory. When I have the new Changes commented out there's the Changeset is added as expected. It seems to be something specifically with the Change data that I can't figure out.
Add call:
rallyApi.add({
"ref":"https://rally1.rallydev.com/slm/webservice/v2.0/hierarchicalrequirement/91834286580",
"collection":"Changesets",
"data":[
{
"Author":{
"_ref":"https://rally1.rallydev.com/slm/webservice/v2.0/user/53634054872"
},
"CommitTimestamp":"2017-03-17T09:52:07-04:00",
"Message":"Feature/tags (#11)",
"Revision":"b8460460254cb79d3e72c98172c164f5c4d3493a",
"Uri":"https://ghe/org/repo/commit/b8460460254cb79d3e72c98172c164f5c4d3493a",
"Changes":[
{
"Action":"M",
"PathAndFilename":"file1.json",
"Uri":"https://ghe/org/repo/commit/b8460460254cb79d3e72c98172c164f5c4d3493a/file1.json"
},
{
"Action":"M",
"PathAndFilename":"file2.json",
"Uri":"https://ghe/org/repo/commit/b8460460254cb79d3e72c98172c164f5c4d3493a/file2.json"
}
],
"SCMRepository":{
"_ref":"https://rally1.rallydev.com/slm/webservice/v2.0/scmrepository/101417587520"
}
}
]
})
Returned error:
{ [Error: Could not create artifact to collection]
errors:
[ 'Could not create artifact to collection',
'Cannot parse object reference from "{null: {"Action": "M", "PathAndFilename": "file1.json", "Uri": "https://ghe/org/repo/commit/b8460460254cb79d3e72c98172c164f5c4d3493a/file1.json"}}"' ] }
It seems to be telling me it tried to find an existing change with that data, but I want to add a new change as specified in the docs and a recent question:
https://github.com/RallyTools/rally-node/wiki/User-Guide#add-to-a-collection
Rally API Add Tags to existing userstory NodeJS
I don't think you can do all of these things at the same time (although that would be pretty cool).
I'd first use the add method to add the changeset like you have specified, but without any changes. And then use the add method again to create the changes on that changeset. Does that work?
Related
I'm getting the following error when using nexus to define a graphql schema with apollo-server.
Error: NEXUS__UNKNOWN__TYPE was already defined and imported as a type
The stacktrace doesn't give much information as to where the issue is occurring or to what the problem is. The project has 20+ models and dozens of resolvers so it's quite hard to debug.
Error: NEXUS__UNKNOWN__TYPE was already defined and imported as a type, check the docs for extending types
at extendError (/Users/username/Documents/folder/folder/graphq-nexus-prisma-api/node_modules/nexus/src/builder.ts:1744:2)
at SchemaBuilder.addType (/Users/username/Documents/folder/folder/graphq-nexus-prisma-api/node_modules/nexus/src/builder.ts:603:8)
at SchemaBuilder.missingType (/Users/username/Documents/folder/folder/graphq-nexus-prisma-api/node_modules/nexus/src/builder.ts:1212:5)
at SchemaBuilder.getOrBuildType (/Users/username/Documents/folder/folder/graphq-nexus-prisma-api/node_modules/nexus/src/builder.ts:1540:4)
at SchemaBuilder.getOutputType (/Users/username/Documents/folder/folder/graphq-nexus-prisma-api/node_modules/nexus/src/builder.ts:1471:10)
at SchemaBuilder.buildOutputField (/Users/username/Documents/folder/folder/graphq-nexus-prisma-api/node_modules/nexus/src/builder.ts:1349:52)
at /Users/username/Documents/folder/folder/graphq-nexus-prisma-api/node_modules/nexus/src/builder.ts:1307:7
at Array.forEach (<anonymous>)
at SchemaBuilder.buildOutputFields (/Users/username/Documents/folder/folder/graphq-nexus-prisma-api/node_modules/nexus/src/builder.ts:1306:7)
at fields (/Users/username/Documents/folder/folder/graphq-nexus-prisma-api/node_modules/nexus/src/builder.ts:1009:33)
Any help appreciated.
I got the same error, but it was because I removed some exports. I'm not exactly sure what caused it, but I basically have a file that exports all of my graphql modules. E.g.
// graphql/modules/index.ts
export * from './file-a';
export * from './file-b';
When I removed the second export line, I started getting the error. I'm probably using some of the types defined in file-b somewhere else, and that's somehow causing the error. Anyway, adding the line back in fixed it (I had removed it by accident anyway).
UPDATE
I also go this by referencing some arg types that didn't exist (typo). For example:
args: {
where: arg({ type: 'ConversationsWhereInput' }),
orderBy: arg({ type: 'ConversationsOrderByInput', list: true }),
},
The s in Conversations shouldn't be there. It should be:
args: {
where: arg({ type: 'ConversationWhereInput' }),
orderBy: arg({ type: 'ConversationOrderByInput', list: true }),
},
It could have been much helpful if you could elaborate what did you do before this error happened.
I just came up with this error exactly as same as what you got and for me it was because I just accidentally changed the name for objectType of typeDef.
For instance, the name for the FollowUserResult was actually FollowResult and after I changed the name, the whole mutation resolvers related to this objectType became wrong.
export const FollowUserResult = objectType({
name: "FollowUserResult", // It was originally "FollowResult"
definition(t) {
t.nonNull.boolean("ok");
t.string("error");
},
});
You may check on this again. Once you got those correct, delete the schema.graphql file and generate the new schema.graphql file.
I got this error because I was using the incorrect Node version. My project didn't have a .nvrmc file (yet) so I was using Node 10 on a project that uses Node 14. So after switching to the correct Node version this error went away
I got this error when I incorrectly specified an unknown type in the type attribute of an extension to the Query type. More specifically:
export const CoursesQuery = extendType({
type: "Query",
definition(t) {
t.field("myQuery", {
type: InvalidType, // <--- Changing InvalidType to the correct type fixed the error
async resolve(_parent, _args, ctx) {
return ...
},
});
},
});
The error disappeared after I changed InvalidType to the correct type and restarted the server.
I bumped into the problem of how to change tabulator's placeholder at runtime. As it is suggested to ask questions on StackOverflow, here it is. There is an issue (closed - https://github.com/olifolkerd/tabulator/issues/1415) having a suggested solution that I tried. Unfortunately, it throws an error during creation:
tabulator.min.js:4 Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.
at s.redraw (tabulator.min.js:4)
at e.h.redraw (tabulator.min.js:6)
at ResizeObserver.<anonymous> (tabulator.min.js:12)
tabulator version is 4.9.3. jsfiddle: https://jsfiddle.net/ivos/6pq75brv/3/
the setup is simple:
var data = [{id:1}, {id:2}, {id:3}];
var placeholder = $("<span>Waiting for data</span>");
var conf = {
// placeholder: "Waiting for data",
placeholder: placeholder,
columns: [
{ title: "Id", field: "id", headerFilter: "input" },
],
dataFiltered: (filters, rows) =>{
placeholder.text(filters.length > 0 ? 'No Results': 'Waiting for data');
},
};
var t = new Tabulator('#tbl', conf);
setTimeout(function(){ t.setData(data)}, 5000); // timeout is just to show the initial placeholder
If I apply a filter (i.e. 5) I got
Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.
at s.redraw (tabulator.min.js:4)
at e.h.redraw (tabulator.min.js:6)
at ResizeObserver.<anonymous> (tabulator.min.js:12)
Because Tabulator uses a virtual DOM you cannot manipulate elements from outside of it.
There is no built in way to change the place holder option once the table has been set.
That being said i can certainly point you to a very hacky way of achieving this, that i would recommend against because it manipulates internal variables and that may result in it not working in future, but it should achieve what you are hoping for.
So assuming you are creating your table on a variable called table, the following should work:
table.options.placeholder = "new placeholder message";
I have an object with the following structure, let's say the object name is apiCall:
{
"Status":"OK",
"ID":"xxx",
"Results":[ ]
}
And this is the structure of the Results array:
[
{
"Call":{
"ID":1,
"CustomerKey":null,
"CustomerID":null
},
"PingID":4,
"Key":null,
"Properties":[
{
"Name":"OrdinalID",
"Value":"1"
}
],
"CreatedDate":"0001-01-01T00:00:00.000",
"ID":0,
"ObjectID":null
}
]
Everything works perfectly fine and I am able to retrieve everything except the nested Properties.
So this is how I retrieve for example Call.ID when iterating through Results - this works fine:
apiCall.Results[i].Call.ID
Now when I try to get the Properties nothing works - I tried parsing, stringifying, and also the following:
apiCall.Results[i].Properties.Value;
apiCall.Results[i].Properties.OrdinalID;
Stringify(apiCall.Results[i].Properties.Value);
nothing from above works.
This is the only thing that somehow worked so far:
Stringify(apiCall.Results[i].Properties);
and it's giving the following result:
[{"Name":"OrdinalID","Value":"1"}]
How can I get to the actual value?
Thank you
Your Properties property is an array, so you need to include an index similar to what you did with Results[i].
Like so: apiCall.Results[i].Properties[0].Value (using 0 as the index here).
I am creating thousands of definitions and making it available on remote so that any one can reuse the defined schema by referring remote ref. at the time of definition creation i want something which can check the $ref and throw error if it is not available
{
"definitions":{
"description100Type":{
"$ref":"#/definitions/additinalType"
}
},
"$schema":"http://json-schema.org/draft-07/schema#",
"$id":"http://example.com/root.json"
}
In the above example description100Type referring additinalType which was not defined.
How to validate the above case ? i am using ajv for validations.
note:ajv is throwing proper error if description100Type is referred inside properties
{
"properties":{
"checked":{
"$id":"#/properties/checked",
"$ref":"#/definitions/description100Type"
}
}
}
Snapshot testing comes handy for testing UI components. If your UI component changes, you are expected to update the snapshot as well to reflect the same. We can specify 'testNamePattern' to update snapshots for a specific test.
jest --updateSnapshot --testNamePattern abc.test.js
Is it possible to mandate 'testNamePattern' while updating snapshots? This will help avoid updating other failing snapshots by mistake. I understand that it is expected to be caught in code review phase. However, I want to ensure that snapshots are always updated for a specific pattern.
As of now, there isn't any CLI option for doing this per doc. I have added a small snippet to my testFrameworkScriptFile to ensure that testNamePattern is passed while updating snapshots.
import yargs from 'yargs';
const mandateTestNamePattern = () => {
const args = yargs.option('testNamePattern', {
type: 'string'
}).option('t', {
type: 'string'
}).argv;
if (args.updateSnapshot || args.u) {
if (args.testNamePattern || args.t) {
// valid case
} else {
throw new Error('TestNamePattern is mandatory while updating snapshots');
}
}
};
mandateTestNamePattern();