{"id":18318538,"url":"https://github.com/maxmind/stepford","last_synced_at":"2025-04-05T21:32:54.884Z","repository":{"id":14112095,"uuid":"16816830","full_name":"maxmind/Stepford","owner":"maxmind","description":"A vaguely Rake/Make/Cake-like thing for Perl - create steps and let a runner run them","archived":false,"fork":false,"pushed_at":"2025-03-20T20:26:42.000Z","size":382,"stargazers_count":9,"open_issues_count":1,"forks_count":5,"subscribers_count":19,"default_branch":"main","last_synced_at":"2025-03-21T12:11:53.834Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://metacpan.org/release/Stepford/","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maxmind.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-02-13T20:51:59.000Z","updated_at":"2025-02-14T20:22:12.000Z","dependencies_parsed_at":"2024-06-21T16:41:53.336Z","dependency_job_id":"1c97c466-c10a-4ed1-a438-87d29b8b0b49","html_url":"https://github.com/maxmind/Stepford","commit_stats":null,"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxmind%2FStepford","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxmind%2FStepford/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxmind%2FStepford/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxmind%2FStepford/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxmind","download_url":"https://codeload.github.com/maxmind/Stepford/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247406079,"owners_count":20933803,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T18:09:56.776Z","updated_at":"2025-04-05T21:32:54.577Z","avatar_url":"https://github.com/maxmind.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NAME\n\nStepford - A vaguely Rake/Make/Cake-like thing for Perl - create steps and let a runner run them\n\n# VERSION\n\nversion 0.006001\n\n# SYNOPSIS\n\n    package My::Step::MakeSomething;\n\n    use autodie;\n    use Moose;\n\n    has input_file =\u003e (\n        traits   =\u003e ['StepDependency'],\n        is       =\u003e 'ro',\n        required =\u003e 1,\n    );\n\n    has output_file =\u003e (\n        traits  =\u003e ['StepProduction'],\n        is      =\u003e 'ro',\n        default =\u003e '/path/to/file',\n    );\n\n    with 'Stepford::Role::Step::FileGenerator';\n\n    sub run {\n        my $self = shift;\n\n        open my $input_fh,  '\u003c', $self-\u003einput_file;\n        open my $output_fh, '\u003e', $self-\u003eoutput_file;\n        while (\u003c$input_fh\u003e) {\n            chomp;\n            print {$output_fh} $_ * 2, \"\\n\";\n        }\n        close $input_fh;\n        close $output_fh;\n    }\n\n    package My::Runner;\n\n    use Stepford::Runner;\n\n    my $runner = Stepford::Runner-\u003enew(\n        step_namespaces =\u003e 'My::Step',\n        logger          =\u003e $log_object,    # optional\n        jobs            =\u003e 4,              # optional\n    );\n\n    # Runs all the steps needed to get to the final_steps.\n    $runner-\u003erun(\n        final_steps =\u003e 'My::Step::MakeSomething',\n    );\n\n# DESCRIPTION\n\nStepford provides a framework for running a set of steps that are dependent on\nother steps. At a high level, this is a lot like Make, Rake, etc. However, the\nactual implementation is fairly different. Currently, there is no DSL, no\nStepfile, etc.\n\nWith Stepford, each step is represented by a class you create. That class\nshould consume one of the available Step roles. Those are:\n\n- [Stepford::Role::Step::FileGenerator](https://metacpan.org/pod/Stepford%3A%3ARole%3A%3AStep%3A%3AFileGenerator)\n\n    For steps that generate files.\n\n- [Stepford::Role::Step](https://metacpan.org/pod/Stepford%3A%3ARole%3A%3AStep)\n\n    For steps that _don't_ generate files.\n\n- [Stepford::Role::Step::FileGenerator::Atomic](https://metacpan.org/pod/Stepford%3A%3ARole%3A%3AStep%3A%3AFileGenerator%3A%3AAtomic)\n\n    For a step that wants to generate a single file atomically.\n\nSteps declare both their dependencies (required inputs) and productions\n(outputs) as attributes. These attributes should be given either the\n`StepDependency` or `StepProduction` trait as appropriate.\n\nThe [Stepford::Runner](https://metacpan.org/pod/Stepford%3A%3ARunner) class analyzes the dependencies and productions for\neach step to figure out what steps it needs to run in order to satisfy the\ndependencies of the final steps you specify.\n\nEach step can specify a `last_run_time` method (or get one from the\n[Stepford::Role::Step::FileGenerator](https://metacpan.org/pod/Stepford%3A%3ARole%3A%3AStep%3A%3AFileGenerator) role). The runner uses this to skip\nsteps that are up to date.\n\nSee [Stepford::Runner](https://metacpan.org/pod/Stepford%3A%3ARunner), [Stepford::Role::Step](https://metacpan.org/pod/Stepford%3A%3ARole%3A%3AStep), and\n[Stepford::Role::Step::FileGenerator](https://metacpan.org/pod/Stepford%3A%3ARole%3A%3AStep%3A%3AFileGenerator), and\n[Stepford::Role::Step::FileGenerator::Atomic](https://metacpan.org/pod/Stepford%3A%3ARole%3A%3AStep%3A%3AFileGenerator%3A%3AAtomic) for more details.\n\n# CONCEPTS AND DESIGN\n\nIn order to understand how Stepford works you must understand a few key concepts.\n\nFirst off, we have steps. A step is simply a self-contained unit of work, like\ngenerating a file, populating a database, etc. There are no restrictions on\nwhat steps can do. The only restriction is that they are expected to declare\ntheir dependencies and/or productions (more on these below).\n\nEach step is a [Moose](https://metacpan.org/pod/Moose) class. Each step class should represent a concrete\naction, not a higher-level concept. In other words, the class name should be\nsomething like \"CopyFooBarFilesToProduction\", **not** \"CopyFiles\". If you have\nseveral steps that all share similar logic, you can use a role to share that\nlogic between classes.\n\nEach step must declare its dependencies and/or productions as regular Moose\nattributes. These attributes can contain any type of value. They are simply\ndata. Note, however, that if you want to run steps in parallel, then the\ndependencies (and therefore productions) must be serializable data types (so\nno [DBI](https://metacpan.org/pod/DBI) handles, etc.).\n\nA dependency is simply a value that a given step expects to get from another\nstep (they can also be supplied to the runner manually).\n\nThe flip side of a dependency is a production. This is a value that the step\nwill generate as needed.\n\nSteps are run by a [Stepford::Runner](https://metacpan.org/pod/Stepford%3A%3ARunner) object. To create this object, you give\nit a list of step namespaces and the class(es) of the final step(s) you want\nto run. The runner looks at the final steps' dependencies and uses this\ninformation to figure out what other steps to run. It looks for steps with\nproductions that satisfy these dependencies and adds any matching steps to the\nexecution plan. It does this iteratively for each step it adds to the plan\nuntil the dependencies are satisfied for every step.\n\nThe runner detects cyclic dependencies (A requires B requires C requires B)\nand throws an error. It also detects when a step has a dependency that cannot\nbe satisfied by the production of any other step.\n\nNote that the matching of production to dependency is done solely by\nname. It's up to you to ensure that the output of a production is something\nthat satisfies the dependency (in terms of the value's type, content, etc.).\n\nIf multiple classes have a production of the same name, then the first class\nthat Stepford sees \"wins\". This can be useful if you want to override a step\nfor testing, for example. See the documentation of the [Stepford::Runner](https://metacpan.org/pod/Stepford%3A%3ARunner)\nclass's `new` method for more details on step namespaces.\n\nIt is not possible for a class to have an attribute that is simultaneously a\ndependency and a production. This would be a natural design for a step that\ntransformed a data value, but it makes dependency resolution\nimpossible. However, nothing stops you from having two attributes that each\nproduce the same **value**. For example, the attributes could both reference a\npath on disk and the step's `run` method could alter the content of that file\nin place.\n\nIt is not currently possible for a class to have optional dependencies. This\nmay be added in the future if it turns out to be useful.\n\n# VERSIONING POLICY\n\nThis module uses semantic versioning as described by\n[http://semver.org/](http://semver.org/). Version numbers can be read as X.YYYZZZ, where X is the\nmajor number, YYY is the minor number, and ZZZ is the patch number.\n\n# SUPPORT\n\nPlease report all issues with this code using the GitHub issue tracker at\n[https://github.com/maxmind/Stepford/issues](https://github.com/maxmind/Stepford/issues).\n\nBugs may be submitted through [https://github.com/maxmind/Stepford/issues](https://github.com/maxmind/Stepford/issues).\n\n# AUTHOR\n\nDave Rolsky \u003cdrolsky@maxmind.com\u003e\n\n# CONTRIBUTORS\n\n- Greg Oschwald \u003cgoschwald@maxmind.com\u003e\n- José Joaquín Atria \u003cjjatria@gmail.com\u003e\n- Kevin Phair \u003cphair.kevin@gmail.com\u003e\n- Mark Fowler \u003cmfowler@maxmind.com\u003e\n- Nick Logan \u003cnlogan@maxmind.com\u003e\n- Olaf Alders \u003coalders@maxmind.com\u003e\n- Ran Eilam \u003creilam@maxmind.com\u003e\n- vti \u003cviacheslav.t@gmail.com\u003e\n\n# COPYRIGHT AND LICENSE\n\nThis software is copyright (c) 2014 - 2023 by MaxMind, Inc.\n\nThis is free software; you can redistribute it and/or modify it under\nthe same terms as the Perl 5 programming language system itself.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxmind%2Fstepford","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxmind%2Fstepford","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxmind%2Fstepford/lists"}