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

feat(log) no progress when --log-json option #405

Merged
merged 1 commit into from
Jul 4, 2024

Conversation

sadayuki-matsuno
Copy link
Collaborator

@sadayuki-matsuno sadayuki-matsuno commented Jul 3, 2024

If this Pull Request is work in progress, Add a prefix of “[WIP]” in the title.

What did you implement:

no progress when --log-json option

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

before

$ goval-dictionary fetch redhat 9 --log-json
{"URL":"https://access.redhat.com/security/data/archive/oval_v1_20230706.tar.gz","lvl":"info","msg":"Fetching... ","t":"2024-07-04T15:57:57.762478332+09:00"}
{"URL":"https://access.redhat.com/security/data/oval/v2/RHEL9/rhel-9-including-unpatched.oval.xml.bz2","lvl":"info","msg":"Fetching... ","t":"2024-07-04T15:57:58.339237811+09:00"}
{"Count":222,"File":"com.redhat.rhsa-RHEL9.xml","Timestamp":"2023-04-05T15:46:46","lvl":"info","msg":"Fetched","t":"2024-07-04T15:58:00.488981711+09:00"}
{"GitHub":"https://github.com/vulsio/goval-dictionary/issues","OVAL":"https://access.redhat.com/security/data/archive/oval_v1_20230706.tar.gz/com.redhat.rhsa-RHEL9.xml","Timestamp":"2023-04-05T15:46:46","lvl":"warn","msg":"The fetched OVAL has not been updated for 3 days, the OVAL URL may have changed, please register a GitHub issue.","t":"2024-07-04T15:58:00.489047717+09:00"}
{"Count":6618,"File":"rhel-9-including-unpatched.oval.xml.bz2","Timestamp":"2024-07-04T05:21:41","lvl":"info","msg":"Fetched","t":"2024-07-04T15:58:02.863895168+09:00"}
{"Family":"redhat","Version":"9","lvl":"info","msg":"Refreshing...","t":"2024-07-04T15:58:02.913138494+09:00"}
{"lvl":"info","msg":"Deleting old Definitions...","t":"2024-07-04T15:58:02.913390083+09:00"}
2776 / 2776 [-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------] 100.00% 10153 p/s
{"lvl":"info","msg":"Inserting new Definitions...","t":"2024-07-04T15:58:03.400642414+09:00"}
2776 / 2776 [------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------] 100.00% 1005 p/s
{"Updated":2776,"lvl":"info","msg":"Finish","t":"2024-07-04T15:58:06.402097675+09:00"}

after

$ goval-dictionary fetch redhat 9 --log-json
{"URL":"https://access.redhat.com/security/data/archive/oval_v1_20230706.tar.gz","lvl":"info","msg":"Fetching... ","t":"2024-07-04T15:56:40.747486014+09:00"}
{"URL":"https://access.redhat.com/security/data/oval/v2/RHEL9/rhel-9-including-unpatched.oval.xml.bz2","lvl":"info","msg":"Fetching... ","t":"2024-07-04T15:56:41.304002386+09:00"}
{"Count":222,"File":"com.redhat.rhsa-RHEL9.xml","Timestamp":"2023-04-05T15:46:46","lvl":"info","msg":"Fetched","t":"2024-07-04T15:56:43.384259448+09:00"}
{"GitHub":"https://github.com/vulsio/goval-dictionary/issues","OVAL":"https://access.redhat.com/security/data/archive/oval_v1_20230706.tar.gz/com.redhat.rhsa-RHEL9.xml","Timestamp":"2023-04-05T15:46:46","lvl":"warn","msg":"The fetched OVAL has not been updated for 3 days, the OVAL URL may have changed, please register a GitHub issue.","t":"2024-07-04T15:56:43.384310261+09:00"}
{"Count":6618,"File":"rhel-9-including-unpatched.oval.xml.bz2","Timestamp":"2024-07-04T05:21:41","lvl":"info","msg":"Fetched","t":"2024-07-04T15:56:46.42350038+09:00"}
{"Family":"redhat","Version":"9","lvl":"info","msg":"Refreshing...","t":"2024-07-04T15:56:46.498856207+09:00"}
{"lvl":"info","msg":"Inserting new Definitions...","t":"2024-07-04T15:56:46.499089826+09:00"}
{"Updated":2776,"lvl":"info","msg":"Finish","t":"2024-07-04T15:56:49.15522991+09:00"}

$ goval-dictionary fetch redhat 9
INFO[07-04|15:58:55] Fetching...                              URL=https://access.redhat.com/security/data/archive/oval_v1_20230706.tar.gz
INFO[07-04|15:58:56] Fetching...                              URL=https://access.redhat.com/security/data/oval/v2/RHEL9/rhel-9-including-unpatched.oval.xml.bz2
INFO[07-04|15:58:59] Fetched                                  File=com.redhat.rhsa-RHEL9.xml Count=222 Timestamp=2023-04-05T15:46:46
WARN[07-04|15:58:59] The fetched OVAL has not been updated for 3 days, the OVAL URL may have changed, please register a GitHub issue. GitHub=https://github.com/vulsio/goval-dictionary/issues OVAL=https://access.redhat.com/security/data/archive/oval_v1_20230706.tar.gz/com.redhat.rhsa-RHEL9.xml Timestamp=2023-04-05T15:46:46
INFO[07-04|15:59:02] Fetched                                  File=rhel-9-including-unpatched.oval.xml.bz2 Count=6618 Timestamp=2024-07-04T05:21:41
INFO[07-04|15:59:02] Refreshing...                            Family=redhat Version=9
INFO[07-04|15:59:02] Deleting old Definitions... 
2776 / 2776 [-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------] 100.00% 12973 p/s
INFO[07-04|15:59:02] Inserting new Definitions... 
2776 / 2776 [------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------] 100.00% 1368 p/s
INFO[07-04|15:59:05] Finish                                   Updated=2776

Checklist:

You don't have to satisfy all of the following.

  • Write tests
  • Write documentation
  • Check that there aren't other open pull requests for the same issue/feature
  • Format your source code by make fmt
  • Pass the test by make test
  • Provide verification config / commands
  • Enable "Allow edits from maintainers" for this PR
  • Update the messages below

Is this ready for review?: YES

Reference

@MaineK00n MaineK00n changed the title feat(db) no progress when --log-json option feat(log) no progress when --log-json option Jul 4, 2024
@MaineK00n MaineK00n merged commit df2b721 into master Jul 4, 2024
13 checks passed
@MaineK00n MaineK00n deleted the no_progress_when_log_json branch July 4, 2024 07:00
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.

2 participants