Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(2243): add displayName #34

Merged
merged 1 commit into from
Oct 14, 2020
Merged

fix(2243): add displayName #34

merged 1 commit into from
Oct 14, 2020

Conversation

wahapo
Copy link
Contributor

@wahapo wahapo commented Oct 10, 2020

Context

fix: screwdriver-cd/screwdriver#2243

Objective

References

License

I confirm that this contribution is made under the terms of the license found in the root directory of this repository's source tree and that I have the authority necessary to make this contribution on behalf of its copyright owner.

);

if (displayName !== undefined) {
m.displayName = displayName;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to update with displayName for workflowGraph? https://github.com/screwdriver-cd/data-schema/blob/master/config/workflowGraph.js

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, that specifies unknown(), it seems to work without adding it, but it's more appropriate to add it.
I tried a bit, but I can't figure out how to add a displayName as an option, and I get a validation error of pipelines[0].workflowGraph.nodes[3].displayName" must be a string 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That does not work.

    nodes: Joi.array().items(Joi.object().keys({
        name: requiresValue,
        displayName: jobName
    }).unknown()),

It didn't work even with the optional() as shown below.

    nodes: Joi.array().items(Joi.object().keys({
        name: requiresValue,
        displayName: jobName.optional()
    }).unknown()),

It seems that an error occurs if the displayName key is omitted.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wonder if it's because the unknown() keyword
okay with merging this PR as-is for now and figuring out how to add displayName to the workflowGraph later

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I've tried everything, but it's still not working. I will do so. Thanks!

Copy link
Contributor Author

@wahapo wahapo Oct 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I've found the cause. It happens when I set the screwdriver.ce/displayName to a number. The job name must be a string, so it can't be a number.

jobs:
  main:
    steps:
      - ls
    image: node:12
    annotations:
      screwdriver.cd/displayName: 0

Checking with SCHEMA_WORKFLOW_GRAPH will result in a 404 error on the pipeline page, so validation step of yaml should return an error. I will consider validating the value of annotations.

@tkyi tkyi merged commit c476f2b into screwdriver-cd:master Oct 14, 2020
@wahapo wahapo deleted the 2243 branch October 15, 2020 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Simplify the job names displayed in pipeline graph
2 participants