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

Offline CSV generation #3146

Merged
merged 2 commits into from Aug 11, 2020
Merged

Offline CSV generation #3146

merged 2 commits into from Aug 11, 2020

Conversation

dracos
Copy link
Member

@dracos dracos commented Aug 10, 2020

Fixes https://github.com/mysociety/fixmystreet-commercial/issues/1926

From the command line, can call with export=2 instead of 1 to get the 202 flow, otherwise is as before.

@codecov
Copy link

codecov bot commented Aug 10, 2020

Codecov Report

Merging #3146 into master will decrease coverage by 0.00%.
The diff coverage is 89.42%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3146      +/-   ##
==========================================
- Coverage   83.49%   83.48%   -0.01%     
==========================================
  Files         250      251       +1     
  Lines       15639    15721      +82     
  Branches     2925     2938      +13     
==========================================
+ Hits        13058    13125      +67     
- Misses       1657     1665       +8     
- Partials      924      931       +7     
Impacted Files Coverage Δ
perllib/FixMyStreet/Cobrand/TfL.pm 85.27% <83.33%> (ø)
perllib/FixMyStreet/App/Controller/Dashboard.pm 87.44% <85.71%> (-2.73%) ⬇️
perllib/FixMyStreet/Cobrand/BathNES.pm 57.95% <87.50%> (-1.83%) ⬇️
perllib/FixMyStreet/Reporting.pm 89.92% <89.92%> (ø)
.../Catalyst/Authentication/Credential/AccessToken.pm 96.15% <100.00%> (+0.50%) ⬆️
perllib/FixMyStreet/App/Controller/Reports.pm 85.64% <100.00%> (+0.07%) ⬆️
perllib/FixMyStreet/Cobrand/Buckinghamshire.pm 65.43% <100.00%> (-0.43%) ⬇️
perllib/FixMyStreet/Cobrand/Oxfordshire.pm 90.62% <100.00%> (-0.10%) ⬇️
perllib/FixMyStreet/Cobrand/Zurich.pm 89.70% <100.00%> (ø)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2922479...e461de7. Read the comment docs.

@dracos dracos force-pushed the offline-csv branch 2 times, most recently from b7dc527 to 63bd527 Compare August 11, 2020 09:47
@dracos dracos requested a review from struan August 11, 2020 09:47
Copy link
Member

@struan struan left a comment

Choose a reason for hiding this comment

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

Not so much anything wrong, but a question and a test nice to have.

my $token = 'access_token=' . $counciluser->id . '-1234567890abcdefgh';
$mech->get_ok("/dashboard/csv/$name?$token");
is $mech->res->code, 202;
}
Copy link
Member

Choose a reason for hiding this comment

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

Should we not also check that if all files are generated it reflects that too. If for no other reason that to check we don't get endless request loops if someone leaves the tab open.

my $cfg = FixMyStreet->config('PHOTO_STORAGE_OPTIONS');
my $dir = $cfg ? $cfg->{UPLOAD_DIR} : FixMyStreet->config('UPLOAD_DIR');
$dir = path($dir, "dashboard_csv")->absolute(FixMyStreet->path_to());
my $subdir = $self->user ? $self->user->id : 0;
Copy link
Member

Choose a reason for hiding this comment

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

Should there not always be a user here?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, kiitc uses the cobrand hook to allow non-authenticated access to the CSV export.

Copy link
Member Author

Choose a reason for hiding this comment

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

Though they will still be using export=1 and not be large, so wouldn't hit this. But still, might as well be safe.

Include a status page, the option for access token requests to use this
system, and a script for manual generation.
Copy link
Member

@struan struan left a comment

Choose a reason for hiding this comment

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

🔢

@dracos dracos merged commit e461de7 into master Aug 11, 2020
@github-pages github-pages bot temporarily deployed to github-pages August 11, 2020 16:17 Inactive
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.

None yet

2 participants