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

[DDW-413] Update support request feature node logs handling #1092

Conversation

thedanheller
Copy link
Contributor

@thedanheller thedanheller commented Sep 17, 2018

This PR updates the node logs handling for the support request feature.

Todo:

  • Logic for the allowed log files
  • Logic for the generated logs

Screenshots:

image


Review Checklist:

Basics

  • PR is updated to the most recent version of target branch (and there are no conflicts)
  • PR has good description that summarizes all changes and shows some screenshots or animated GIFs of important UI changes
  • CHANGELOG entry has been added and is linked to the correct PR on GitHub
  • Automated tests: All acceptance tests are passing (yarn run test)
  • Manual tests (minimum tests should cover newly added feature/fix): App works correctly in development build (yarn run dev)
  • Manual tests (minimum tests should cover newly added feature/fix): App works correctly in production build (yarn run package / CI builds)
  • There are no flow errors or warnings (yarn run flow:test)
  • There are no lint errors or warnings (yarn run lint)
  • Text changes are proofread and approved (Jane Wild)
  • There are no missing translations (running yarn run manage:translations produces no changes)
  • UI changes look good in all themes (Alexander Rukin)
  • Storybook works and no stories are broken (yarn run storybook)
  • In case of dependency changes yarn.lock file is updated

Code Quality

  • Important parts of the code are properly documented and commented
  • Code is properly typed with flow
  • React components are split-up enough to avoid unnecessary re-rendering
  • Any code that only works in Electron is neatly separated from components

Testing

  • New feature / change is covered by acceptance tests
  • All existing acceptance tests are still up-to-date
  • New feature / change is covered by Daedalus Testing scenario
  • All existing Daedalus Testing scenarios are still up-to-date

After Review:

  • Merge PR
  • Delete source branch
  • Move ticket to done on the Youtrack board

@CodiePP
Copy link
Contributor

CodiePP commented Sep 18, 2018

👍

@nikolaglumac
Copy link
Contributor

@daniloprates please don't forget to implement the logic where we always pack most fresh node logs. We don't want to end up in a situation where we pick just 3 random ones...

@@ -40,13 +23,16 @@ export default () => {
const logFiles = [];
if (fs.existsSync(pubLogsFolderPath)) {
const files = fs.readdirSync(pubLogsFolderPath);
Copy link
Contributor

Choose a reason for hiding this comment

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

can you split your loop into two parts: one for Daedalus files and one for node files?
and then, read the node log directory using the regexp ALLOWED_NODE_LOGS?
the reason I ask is because we want to add a symlink to the recent log file, and this symlink should not be included in the log file list.

Copy link
Contributor

Choose a reason for hiding this comment

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

also, I don't know if fs.readdirSync will return the file list sorted. Maybe sorting it is a more safe option.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@CodiePP not sure I understand the need for 2 loops since both will loop through the same files list. What is the symlink file name?

@nikolaglumac
Copy link
Contributor

@daniloprates @CodiePP this PR is now updated to contain V1 Api integration. The installers produced by the CI are using the tip of the Cardano-sl develop branch for the backend - this means we will be able to see if this new logging setup works or not ;)

@thedanheller thedanheller removed the WIP label Sep 21, 2018
@thedanheller
Copy link
Contributor Author

🎉

image

@nikolaglumac
Copy link
Contributor

@daniloprates are you 100% sure these 3 are the latest ones?

@nikolaglumac
Copy link
Contributor

@daniloprates also if this from the installer then we should have the launcher log in the list too?

@nikolaglumac nikolaglumac self-requested a review September 21, 2018 13:55
@thedanheller
Copy link
Contributor Author

thedanheller commented Sep 21, 2018

@nikolaglumac:

@daniloprates are you 100% sure these 3 are the latest ones?

You are right, it was getting the oldest ones. 0239b06 fixes it:

image

@daniloprates also if this from the installer then we should have the launcher log in the list too?

No other files being generated:

image

@nikolaglumac
Copy link
Contributor

@daniloprates launcher log should be there too. We need to investigate this. @CodiePP can you assist us here?

@nikolaglumac
Copy link
Contributor

@cleverca22 do you have some context on missing launcher log in cardano pub dir?

@cleverca22
Copy link
Contributor

the launcher log file now has node in the name
https://github.com/input-output-hk/cardano-sl/blob/515afc3fb6e8b9804a6c325defa95a778df8c8e8/tools/src/launcher/Main.hs#L316-L323
the name will need to be altered here if you want seperate launcher and node logs

@nikolaglumac
Copy link
Contributor

@cleverca22 are you saying we won't have a separate launcher log in the future? And that it will be outputted into node-pub logs?

@cleverca22
Copy link
Contributor

its probably a typo, and we just need to fix launcher to write to launcher-<date>

@nikolaglumac
Copy link
Contributor

@cleverca22 @daniloprates @CodiePP we need to know the exact launcher log file name in order to add it to our logs-packing whitelist. Can we have some more clarity on this one?

@CodiePP
Copy link
Contributor

CodiePP commented Sep 24, 2018

we have to adapt the launcher code to reproduce what it was before. will dig it out..
but, I think that it should be launcher-<timestamp> as Michael proposed.

@365andreas will prepare a PR..

@nikolaglumac
Copy link
Contributor

@CodiePP it used to be just launcher file...

@CodiePP
Copy link
Contributor

CodiePP commented Sep 24, 2018

yes, but all the log files that go through katip now have this timestamp at the end because of log rotation.

@nikolaglumac
Copy link
Contributor

@CodiePP do you think it is sufficient to pack only the latest launcher log? Or should we pack 2 of the latest? Even 3?

@CodiePP
Copy link
Contributor

CodiePP commented Sep 24, 2018

I think it can be done the same way as the node log: 3 latest logs.

@nikolaglumac
Copy link
Contributor

Thanks @CodiePP!
@daniloprates please add the logic which will pack the 3 most fresh launcher logs. Thanks!

@CodiePP
Copy link
Contributor

CodiePP commented Sep 24, 2018

this is the PR: input-output-hk/cardano-sl#3655

@nikolaglumac
Copy link
Contributor

@CodiePP please notify us here once the Cardano PR has been merged. After that is done we will need to point the cardano revision to the tip of the develop branch in order to generate the installers which will use your code on Cardano side.

@nikolaglumac
Copy link
Contributor

@daniloprates I have updated the cardano version used in this PR. After the CI produces the installers we can finally do our end-to-end tests :)

@thedanheller
Copy link
Contributor Author

image

🎉

Copy link
Contributor

@nikolaglumac nikolaglumac left a comment

Choose a reason for hiding this comment

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

Great work @daniloprates 🎉

@nikolaglumac nikolaglumac merged commit 3d0bb8c into develop Oct 2, 2018
@nikolaglumac nikolaglumac deleted the feature/ddw-413-update-support-request-feature-node-logs-handling branch October 2, 2018 20:05
This was referenced Oct 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants