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

[CTAN] fallback to date if version is empty #9036

Merged
merged 11 commits into from
Mar 29, 2023
Merged

[CTAN] fallback to date if version is empty #9036

merged 11 commits into from
Mar 29, 2023

Conversation

muzimuzhi
Copy link
Contributor

@muzimuzhi muzimuzhi commented Mar 27, 2023

I'm new to node.js, hence this PR is more or less an imitation of existing code in the same repo.

Do you suggest to make version.date in schema also required?

Update: I did a test in https://github.com/muzimuzhi/shields/commit/80c1fe94c9106659ec010d6b5247edb103f8a377. Surprisingly, without adding date: "..." to examples and tests, all checks passed.

Fixes #9017

@github-actions
Copy link
Contributor

github-actions bot commented Mar 27, 2023

Messages
📖 ✨ Thanks for your contribution to Shields, @muzimuzhi!

Generated by 🚫 dangerJS against 5ebfe4f

Copy link
Member

@chris48s chris48s left a comment

Choose a reason for hiding this comment

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

Thanks for picking this up :) Couple of minor comments


const schema = Joi.object({
license: Joi.array().items(Joi.string()).single(),
version: Joi.object({
number: Joi.string().required(),
number: Joi.string().allow('').required(),
date: Joi.string().allow(''),
Copy link
Member

Choose a reason for hiding this comment

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

if we expect this to be present in the response but set to empty string to indicate "not set" then yes it should be .required()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In https://github.com/muzimuzhi/shields/commit/80c1fe94c9106659ec010d6b5247edb103f8a377 I added .required() to date without adding date entry to tests. Surprisingly, all checks passed. Is this the expected result?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seems it's because not all workflows are triggered by pushing to my fork. date entries are required.

services/ctan/ctan.tester.js Outdated Show resolved Hide resolved
Copy link
Member

@chris48s chris48s left a comment

Choose a reason for hiding this comment

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

nice LGTM 👍

@chris48s chris48s added service-badge Accepted and actionable changes, features, and bugs squash when passing labels Mar 29, 2023
@repo-ranger repo-ranger bot merged commit 6deeadc into badges:master Mar 29, 2023
@muzimuzhi muzimuzhi deleted the ctan-date-as-version branch March 30, 2023 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service-badge Accepted and actionable changes, features, and bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Some version badges for CTAN packages are broken
2 participants