feat: check_win: add webform
argument as alternative to FTP upload
#2619
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The existing
check_win_*()
functions use passive FTP to upload package tarballs to WinBuilder. FTP is increasingly deprecated or blocked in modern network environments due to security policies, firewall restrictions, or lack of support.WinBuilder also provides a webform-based submission interface (upload.aspx) that accepts HTTP POST requests.
In this PR a new argument
webform = FALSE
is added to allcheck_win_*()
functions. Whenwebform = TRUE
, the package is submitted via HTTP POST to the ASP.NET form.The implementation performs a GET request to retrieve the form and extract required hidden fields: __VIEWSTATE, __VIEWSTATEGENERATOR, __EVENTVALIDATION. Then, it constructs a multipart/form-data POST request to upload the package. The correct field names are selected based on the R version (R-release, R-devel, or R-oldrelease).
I needed this functionality because
check_win_devel()
and friends time out when attempting FTP submission on my work network, and I prefer the convenience of an R command to submit rather than manually entering into web form or using FTP. It seems to work well for my purposes.I would be happy to revise this PR further if there is interest in incorporating this feature into official devtools.
Happy to change it up if there are better ways to implement, just wanted to identify the issue and provide the proof-of-concept.
Also, if needed I can add tests, but since the FTP-based functionality is not currently tested / mocked I did not implement that for this alternative option.
Thank you in advance for your consideration