GithubHelp home page GithubHelp logo

dmarc_aggregate_parser's People

Contributors

bas-man avatar bbustin avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

dmarc_aggregate_parser's Issues

parse_dir function thoughts

Hi @bbustin,
I have taken a longer look at parse_dir() and I think there are a few issues with the function. As you mentioned you put this together while learning Rust. I myself am still learning Rust :). I would personally use it for my own small projects. But it has some issues when being considered for use in the larger more complex system.

  • Unable to mark files as processed, or rename, remove files that have successfully been processed. This means that files need be manually updated to avoid duplication or reprocessing.
  • I also suspect that if there is a file that causes an error, any following files would not be processed until the offending file is fixed/removed.

The general approach I have used and seen used is something along the lines of the following dodgy pseudo code

for file in dir {
  file = parse()
  if file is ok {
    Do any work that needs to be done. 
    If there is a problem log and report issue and move to the next file without making any system changes.
    If the work completes successfully. Mark the file as processed or remove it.
  } else {
    log and report file as a problem
  }
}

This basically is the long way of saying the parse_dir function is great for testing :) but not so much for production environment as I see things.

Contributing to this Repo: remove panic and unwrap

Hi,
I am interested in contributing to this repo. I was thinking of writing my own. But this seems to be a great place to start and contribute.

Some of the issues that I see in the code that I think I can help with.

  • Code has a panic hard coded. I would like to remove this and make the function return a result
  • There are a number of unwraps that might fail on a malformed xml file.
  • Have the program handleparsing a directory as a Path in a nice way.

I have already raised two PRs to address some very simple things.

  • Prevent the tests for failing with test_parse_dir by adding the #[should_panic] See pr #3
  • Made parse_reader private as this does not need to be public in the current code.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.