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

Add group creation date to issues and group json #216

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jakedane
Copy link

@jakedane jakedane commented May 8, 2023

Through the json interface currently there is no way to find when a group was created. If an app for example uses /issues/vulnerable.json and needs this information it currently additionally has to download the group html for each group and parse the "Created date" from the html.

This MR adds group.created as 'date' to the issues and group json so for example downloading /issues/vulnerable.json would include this information and no additional download for each group is needed.

It uses Y-m-d date format same as is used for advisories creation date in package json.

Copy link
Member

@jelly jelly 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 the contribution! It would be nice to have a small unit-test to verify if the date was set.

Through the json interface currently there is no way to find when a
group was created. If an app for example uses /issues/vulnerable.json
and needs this information it currently additionally has to download the
group html for each group and parse the "Created date" from the html.

This MR adds group.created as 'date' to the issues and group json so for
example downloading /issues/vulnerable.json would include this
information and no additional download for each group is needed.

It uses Y-M-d date format same as is used for advisories creation date
in package json.
@jakedane
Copy link
Author

@jelly to the issues and group json tests I've added a check that date was set correctly.

@anthraxx
Copy link
Member

@jakedane can you please give me a full user story to understand what you are trying to use this feature for?

@jakedane
Copy link
Author

jakedane commented May 15, 2023

@anthraxx I'd use it for a security status check, part of a larger status app. I already download /issues/vulnerable.json (max once per 24 hours) to show which installed packages have a vulnerability but I'd like to add since when each vulnerability has been open and this PR would add that data to the json.

As alternative I have considered to diff the download with a previous download to find added groups and note the date each group was added in a client side cache, so from there I can get since when each vulnerability has been open. But as this is done client side that would be (wildly) inaccurate unless the status app is run every day. Another alternative, that is accurate, would be to download the html for each group and parse the html to get the created date and parse that back into a date value somehow. I figured it would be nicer to not cause a lot of downloads and instead have the data in the json already, which is what this PR does.

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.

None yet

3 participants