Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@javierron
Copy link
Contributor

Here is an implementation of the feature described on https://github.com/dabutvin/Imgbot/issues/352

This was implemented such that when a rebase is triggered, only the conflicted images and possibly new images would be re-compressed.

In order for this to work, the app should be updated to trigger the issue_comment webhook.

Authors: @s1grun and @javierron

@javierron javierron force-pushed the rebase branch 2 times, most recently from d94d369 to 34822ed Compare April 14, 2020 15:26
@dabutvin
Copy link
Contributor

awesome! I'll take a look and do some testing soon

@s1grun
Copy link
Contributor

s1grun commented Apr 21, 2020

Hi @dabutvin, I hope you're well!

We just wanted to check in regarding the status of the PR. Implementing this is a part of an assignment, in a course at KTH for our master program, that has the deadline on the 30th of April. No pressure though, but it would be so great to get feedback before that if possible. Thank you in advance!

@dabutvin
Copy link
Contributor

@s1grun understood. I will do my best πŸ˜„

@s1grun
Copy link
Contributor

s1grun commented May 8, 2020

Hi @dabutvin,

Just touching base, have you had any time to take a look at the PR?

Copy link
Contributor

@dabutvin dabutvin left a comment

Choose a reason for hiding this comment

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

Hey great work so far!

Check out my comment about automatically running the rebase for everyone instead of requiring the issue comment.

Let me know what you think!

🀠

}

repo.Commit(commitMessage, signature, signature);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Really interesting thought about optimizing the process to only compress the new or modified images πŸ‘
This is something I've thought about in the past, and it could really reduce the cost of running the service.

Having this as part of the rebase is one small part of the overall optimization, because as it stands, every time a new image is added, when we are not rebasing, we run the optimizer over every single image anyway.
A huge win would be to figure out how to do this outside of the rebase for all ongoing optimization runs.

Because of the complexity here, I'd like to pull this functionality into a separate PR. Let's get the rebase feature all finished up and shipped and then come back to focus on optimizing the compute resources looking at the whole system. For the first iteration, when we rebase, we can trigger a full optimization run.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, removing this for now πŸ‘

For optimizing the whole thing, what do you think about a checksum-based solution? We could store all (filename,checksum) entries on a table, and compare every time the compression function is called, therefore compressing only the images in which the checksum does not match.

In terms of operation cost, this solution would mean a storage/processing trade-off. I believe in the long run, and specially in repositories with hundreds/thousands of images the trade-off would be justified.

Copy link
Contributor

Choose a reason for hiding this comment

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

that's a cool idea πŸ‘ and i think you're right, could be a huge win in the long run.
Not sure how familiar you with azure storage, but ideally we could pull this off with using either blobs or tables https://docs.microsoft.com/en-us/azure/storage/common/storage-introduction in a performant way.

@javierron
Copy link
Contributor Author

Hey! Thanks for the review!

We will address your feedback soon and update the PR accordingly.

πŸ‘πŸ»

Co-Authored-By: Sigrun Arna Sigurdardottir <[email protected]>
Co-Authored-By: Javier Ron <[email protected]>
@javierron
Copy link
Contributor Author

@dabutvin The changes you requested are now uploaded 😎

- Move ParseCommitMessage functiopn to CommitMessage.cs
- Validate that head commit of imgbot branch is made by imgbot
- Remove re-compress optimization
- Remove issue_comment hook and rebase if branch already exists

Co-Authored-by: Sigrun Arna Sigurdardottir <[email protected]>
Co-Authored-by: Javier Ron <[email protected]>
@stale
Copy link

stale bot commented Jul 18, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the goneStale label Jul 18, 2020
@javierron
Copy link
Contributor Author

javierron commented Jul 21, 2020

@dabutvin Any update on this? I'll be glad to keep working on this and get it merged if it's still relevant.

@stale stale bot removed the goneStale label Jul 21, 2020
@dabutvin
Copy link
Contributor

thanks for the reminder @javierron
I totally let this slip. I'll take a look soon πŸ‘

Copy link
Contributor

@dabutvin dabutvin left a comment

Choose a reason for hiding this comment

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

Works great! πŸŽ‰ πŸŽ‰
Thanks so much for working through this and being patient. I think people are really going to appreciate this one.

@dabutvin dabutvin merged commit e6d5db5 into imgbot:master Aug 8, 2020
@dabutvin dabutvin changed the title Implemented a user-triggered rebase feature Implemented a rebase feature Aug 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants