Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Item14055: recalculate filesize after beforeUploadHandler #8

Closed
wants to merge 1 commit into from

Conversation

phkehl
Copy link
Contributor

@phkehl phkehl commented Apr 24, 2016

Plugins can modify the file/stream's content of uploaded/attached files (according to the API docu in Foswiki::Plugins::EmptyPlugin). Hence, we need to recalculate the filesize after the handler(s) have been called.

@gac410
Copy link
Member

gac410 commented Apr 24, 2016

Hi, Thanks for the patch.

It would be helpful if when you encounter a bug, you could open a task on https://foswiki.org/Tasks so that we can track it for inclusion into an upcoming release. Please describe the symptoms of what the patch fixes, (What are the symptoms of the incorrect filesize), and use the assigned Item number in the commit log summary. ie, something like:
Item1234: Recalculate filesize after beforeUploadHandler.

This way, it gets pulled into the release notes, and the commits are tracked against the bug report.

Thanks,
George

@phkehl
Copy link
Contributor Author

phkehl commented Apr 24, 2016

OK, thanks for the info.
I will do that.

Plugins can modify the file/stream's content of uploaded/attached
files(according to the API docu in Foswiki::Plugins::EmptyPlugin).
Hence, we need to recalculate the filesize after the handler(s)
have been called.
@phkehl
Copy link
Contributor Author

phkehl commented Apr 24, 2016

@phkehl phkehl changed the title recalculate filesize after beforeUploadHandler Item14055: recalculate filesize after beforeUploadHandler Apr 24, 2016
@gac410
Copy link
Member

gac410 commented Apr 24, 2016

By the way, I guess we have a bit of a hole in our development process. When you pseudo-install a git checkout of the foswiki/distro repository, you should be getting "commit" and "comment" git hooks installed locally which will validate you commits. These hooks perform a couple of functions:

  • commit hook Verifies that the code is "tidy" and that topics have valid META.
  • comment hook validates that the Task item exists and is a state ready to accept patches.

I guess we don't install the hooks automatically in a "forked" repository. We'll need to look into that. The hooks are in distro/core/tools/develop/githooks

@gac410
Copy link
Member

gac410 commented Apr 24, 2016

Merget in to master, and cherry-picked into Release02x01 for the 2.1.1 release. Thanks

@gac410 gac410 closed this Apr 24, 2016
@phkehl
Copy link
Contributor Author

phkehl commented Apr 24, 2016

The hooks are installed. I tried again with a dummy commit in a local branch (of my forked repo). Now I do get the "ERROR: ...something... is not tidy; cannot check in:", the "No Bug item in log message" as well as the "Item99999999 does not exist" messages.

I'm not sure why I didn't get it before.

@gac410
Copy link
Member

gac410 commented Apr 24, 2016

Mysteries ... I've run a tidy, everything is merged, unit tests still pass, and task is waiting for release in 2.1.1, which should happen soon.

@phkehl
Copy link
Contributor Author

phkehl commented Apr 24, 2016

Thanks. I've tested it again and my tidy reports the same stuff you've now tidied.

I known now what has happened (and reproduced it with a new clean clone).

I've added github.com/foswiki/distro as a remote (git remote add upstream https://github.com/foswiki/distro.git) and then pseudo-installed something else. That has added the hooks:

./pseudo-install.pl ImagePlugin
[...]
Installing hooks for repo: /mnt/fry/d1/flip/foswiki-dev/ImagePlugin/.git Git origin URL: remote.origin.url=git@github.com:foswiki/ImagePlugin.git
Linked /mnt/fry/d1/flip/foswiki-dev/core/tools/develop/githooks/commit-msg as /mnt/fry/d1/flip/foswiki-dev/ImagePlugin/../ImagePlugin/.git/hooks/commit-msg
Linked /mnt/fry/d1/flip/foswiki-dev/core/tools/develop/githooks/pre-commit as /mnt/fry/d1/flip/foswiki-dev/ImagePlugin/../ImagePlugin/.git/hooks/pre-commit
 ImagePlugin installed
Installing hooks for repo: /mnt/fry/d1/flip/foswiki-dev/.git Git origin URL: remote.upstream.url=https://github.com/foswiki/distro.git
Linked /mnt/fry/d1/flip/foswiki-dev/core/tools/develop/githooks/commit-msg as /mnt/fry/d1/flip/foswiki-dev/core/../.git/hooks/commit-msg
Linked /mnt/fry/d1/flip/foswiki-dev/core/tools/develop/githooks/pre-commit as /mnt/fry/d1/flip/foswiki-dev/core/../.git/hooks/pre-commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants