theSteveMitchell / after_party

Automated post-deploy tasks for Ruby/Rails. Your deployment is the party. This is the after party
MIT License
241 stars 50 forks source link

Tasks are out of order in status #29

Closed aaronbronow closed 5 years ago

aaronbronow commented 7 years ago

Hi, any idea why the tasks appear out of order when I run after_party:status?

Thanks screen shot 2016-12-05 at 1 04 23 pm

BartlomiejSkwira commented 7 years ago

+1 on this one

theSteveMitchell commented 7 years ago

Yep, currently the task uses a Dir[<mask>].collect... to find all the existing task files https://github.com/theSteveMitchell/after_party/pull/24

it's not looking them up in the DB, because we want to list tasks that haven't run yet. Dir command doesn't sort by filename automatically. That's easy to add as Dir[<mask>].sort.collect...

Although I'd prefer to move the logic from that :status task into TaskRecorder class. I would also change that logic to both pull files and existing migrations in the DB, and union the two sources. That would handle the case where old task files were deleted (and unlike DB migrations, I do encourage deleting old task files, once they are no longer needed).

BartlomiejSkwira commented 7 years ago

@theSteveMitchell I think a better way would be to sort them oldest(top), newest(bottom), just like migrations. So the timestamp would be the sorting argument

michaelirey commented 6 years ago

@theSteveMitchell To understand better, the case you were describing about old task files getting deleted. What were you thinking of displaying in the output of after_party:status when these deleted files are detected.

lacostenycoder commented 5 years ago

@theSteveMitchell is anyone maintaining this repo anymore?

theSteveMitchell commented 5 years ago

@aaronbronow @lacostenycoder apologies. This is addressed in #40, and I'll release a new version in the next day or two with that improvement.

I've not had capacity to maintain this for quite some time, but I'm back. I'll be working through the open queue and plan on releasing a V2 in the next few weeks. I'll also be looking for additional maintainers soon.