-
Notifications
You must be signed in to change notification settings - Fork 17
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
feat(2331): Expand step object for job validation [1] #437
Conversation
module.exports = { | ||
up: async (queryInterface, Sequelize) => { | ||
await queryInterface.sequelize.transaction(async (transaction) => { | ||
await queryInterface.addColumn(table, 'locked', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will be we adding individual columns for use cases like retry, continue on error ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's better for validation and quicker lookup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but for template key probably don't need that actually
// Template steps | ||
const SCHEMA_TEMPLATE_STEP_SUBOBJECT = SCHEMA_STEP_SUBOBJECT_BASE | ||
.keys({ | ||
locked: Joi.boolean() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be optional ? should we allow users to define the step object format without any attributes ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's okay
the template-validator/config-parser can convert the non-attribute step objects to the simplified version
Context
It would be nice if template owners could indicate which steps cannot be overwritten in their templates. In order to allow for this change (and other step expansions), it would be nice if steps can be expanded to more than just a string or single key-value object.
Objective
This PR adds the option to expand step object from previous formats
'npm publish'
/{ deploy: npm publish }
to allow for more complex objects{ deploy: { command: 'npm publish', locked: true } }
.Also adds
locked
field to step.References
Related to screwdriver-cd/screwdriver#2331
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.