GithubHelp home page GithubHelp logo

Comments (15)

pborreli avatar pborreli commented on June 18, 2024

Thinking of a Processing class to move out logic from the consumer

from composer-service.

liuggio avatar liuggio commented on June 18, 2024

Yes a processor class and also multiple tasks objects injected via DIC via composition.

In this way all tasks would be easily tested...

from composer-service.

pborreli avatar pborreli commented on June 18, 2024

agree, not sure what do you mean by task ?

from composer-service.

cordoval avatar cordoval commented on June 18, 2024

he means specific process command or such

from composer-service.

liuggio avatar liuggio commented on June 18, 2024

If the objective is clean-up a little bit and add a test for each step,
creating a similar class with a big process function is not the best.

Another solution is create a Processing class with a function for each step,
but would be difficult to have unit tests (or we test private functions that is not so good), so we'd have to add functional testing.

Another way of doing it and maybe is over engineered:
create multiple steps (or task), each step does only one thing.

New Processing

  • argument:
    1. DumpFileStep
    2. ComposerInstallStep
    3. CheckVulnerabilitiesStep
    4. ServeVendorStep

The steps are classes that implements an interface with a method execute (or something like that).

Other ideas?

Other smells that I see: Filesystem and SecurityChecker are not injected.

from composer-service.

pborreli avatar pborreli commented on June 18, 2024

👍 feel free if you want to contribute, I'd be glad :)

from composer-service.

liuggio avatar liuggio commented on June 18, 2024

I'm on holiday now :) if this will be not closed when I'll come back on mid-jan I'll look into it 👍

from composer-service.

cordoval avatar cordoval commented on June 18, 2024

@liuggio non sapevo italiano ha preso Vacanze ❗

from composer-service.

pborreli avatar pborreli commented on June 18, 2024

@liuggio thanks, have a great time and happy new year ;)

from composer-service.

youbs avatar youbs commented on June 18, 2024

Can I take a shot at this please?

I like this project, for now I just contributed a few lines on projects but I'd like to be more involved in some stuff.
There is a good chance that I mess this up, but eh, I have to start somewhere (plus maybe @liuggio can point me in the right direction ?) :)

from composer-service.

cordoval avatar cordoval commented on June 18, 2024

@youbs feel free to contribute, take a stab

from composer-service.

pborreli avatar pborreli commented on June 18, 2024

@youbs you are more than welcome, don't worry, we'll help you

from composer-service.

liuggio avatar liuggio commented on June 18, 2024

👍 @youbs let us know

from composer-service.

youbs avatar youbs commented on June 18, 2024

Hi,

I started to work on this and went with @liuggio's idea with the steps.
I ran into an issue concerning the generated temp path (with the uniqid). I'd need to access it from several different steps. Anyone got an idea how to handle that?

(I can open a WIP PR if needed)

from composer-service.

cordoval avatar cordoval commented on June 18, 2024

please do @youbs

from composer-service.

Related Issues (20)

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.