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

Improve temp filename generation #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mariusbuescher
Copy link

Prevent validator from stopping when URIs with get parameters are validated. Temporary filename is generated in another way.

Prevent validator from stopping when URIs with get parameters are validated
@vikash-bhardwaj
Copy link
Owner

Thanks for the contribution Marius, can you please elaborate on this particular change as I am not able to understand the reason for this change because ideally this is just the temp file name?

@mariusbuescher
Copy link
Author

The problem with those filenames is that there is some kind of caching mechanism so when a URL is validated successful the folowing URLs are not validated or considered as validated successful. This problem only occurs when you try to validate URLs with a GET-Parameters.

@webfeature
Copy link

Same issue here. Would be nice if you can accept the pr.

@vikash-bhardwaj
Copy link
Owner

Hi @webfeature,

Thanks for reaching out, just to update that I have already taken care for removing all the special characters along with protocol from the file name. Latest version shouldn't have any issue wrt special characters, if you are facing some other issue then please let me know.

In the current version the only difference in the file name from what @mariusbuescher requested as part of his changes is that file name will not be generated with whole URL and it will be taken only from last 2 values separated by "/" in URL and it can be anything. Rest all changes from @mariusbuescher has been taken into consideration.

Why we have done this is because sometime URL can be too long and a very lengthy name can be a problematic to be used on Windows machines.

Please let me know if this doesn't work and you expect the file name to be generated from whole URL.

@vikash-bhardwaj
Copy link
Owner

@mariusbuescher,

Can I close the request if the intended behavior is achieved in the latest plug-in as I have achieved what you were expecting in latest version of plug-in with just some changes?

Thanks for your support and let me know if you have more feedback/comments.

Thanks
Vikash Bhardwaj

@webfeature
Copy link

Hi vikash-bhardwaj,

in the latest version i still facing the same problem. This is the setup:

remotePath: 'http://url.to.test/
remoteFiles: [
       'index.php', 
       'index.php?id=10'
   ],

In this case url_tempvlidation.html is created for the first file. The second remote file is skipped, because thr url_tempvlidation.html file already exists.

@vikash-bhardwaj
Copy link
Owner

Hey Marius,

Thanks for the data I will take this up tomorrow or please send me a fresh
pull request on latest code because some of your recommendation should
already be in code.

Thanks for your contribution man!!

Thanks
Vikash Bhardwaj

On Mon, Aug 31, 2015 at 9:22 PM, webfeature notifications@github.com
wrote:

Hi vikash-bhardwaj,

in the latest version i still facing the same problem. This is the setup:

remotePath: 'http://url.to.test/
remoteFiles: [
'index.php',
'index.php?id=10'
],

In this case url_tempvlidation.html is created for the first file. The
second remote file is skipped, because thr url_tempvlidation.html file
already exists.


Reply to this email directly or view it on GitHub
#3 (comment)
.

@icn2you
Copy link

icn2you commented Sep 3, 2015

Hi, Vikash!

Just wanted to make you aware of two errata in the documentation for this plugin:

  • The load task should begrunt.loadNpmTasks(grunt-w3c-html-validation);, rather thangrunt-html-validation.
  • To revalidate all the validated files, you rungrunt validation --reset=true, rather than validate.

Thanks for your time and help.

Warm regards,

Chris

@vikash-bhardwaj
Copy link
Owner

Hi Chris,

Thanks for the catch and I have published the new plug-in with some fixes
where I have incorporated these as well.

I hope this helps and thanks for highlighting this.

Regards
Vikash

On Thu, Sep 3, 2015 at 12:05 PM, Christopher Zenner <
notifications@github.com> wrote:

Hi, Vikash!

Just wanted to make you aware of two errata in the documentation for this
plugin:

  • The load task should begrunt.loadNpmTasks(grunt-w3c-html-validation);,
    rather thangrunt-html-validation.
  • To revalidate all the validated files, you rungrunt validation
    --reset=true, rather than validate.

Thanks for your time and help.

Warm regards,

Chris


Reply to this email directly or view it on GitHub
#3 (comment)
.

@vikash-bhardwaj
Copy link
Owner

Hi @webfeature,

With the data you provided actually there were issues because plug-in was
just overwriting the index.php report with the later one. Now it will
generate separate report properly.

Please test your scenario and let me know if you still face issue with
latest plug-in code.

Thanks again for highlighting this.

Vikash

On Tue, Sep 1, 2015 at 9:25 PM, Vikash Bhardwaj vikasbhardwaj7@gmail.com
wrote:

Hey Marius,

Thanks for the data I will take this up tomorrow or please send me a fresh
pull request on latest code because some of your recommendation should
already be in code.

Thanks for your contribution man!!

Thanks
Vikash Bhardwaj

On Mon, Aug 31, 2015 at 9:22 PM, webfeature notifications@github.com
wrote:

Hi vikash-bhardwaj,

in the latest version i still facing the same problem. This is the setup:

remotePath: 'http://url.to.test/
remoteFiles: [
'index.php',
'index.php?id=10'
],

In this case url_tempvlidation.html is created for the first file. The
second remote file is skipped, because thr url_tempvlidation.html file
already exists.


Reply to this email directly or view it on GitHub
#3 (comment)
.

@webfeature
Copy link

Hi Vikash,

it's working now. Thank you for your support.

But i think it is not working in every scenario correctly:

  • If each validated file included an validation error everything is working fine
  • when some files are error free and some still have errors (in my case simulated with relaxerror option)
    • in the first run, everything is working normally
    • in the second run, also files with errors get validated succesful (no error is thrown)
    • in the third run, all files are skipped

When i remove the validation-status.json everything is working fine again.

I think, it should exist an option for ignoring the validation-status.json. Because in some scenarios you want to revalidate all files.

Best regards,
Christian

@vikash-bhardwaj
Copy link
Owner

@webfeature - I have tried to run with Error free files in between on files with errors and for me test run every time, it doesn't skip or break for me.

Can you please confirm if you testing remote URLs or local files, I have tested with local files and I am not able to reproduce it?

Regards
Vikash

@webfeature
Copy link

Hi Vikash,

i tested it with remote files. Sorry for the incomplete description of the problem.

Regrads,
Christian

@vikash-bhardwaj
Copy link
Owner

can you please provide the test data which you tested or I can take any
public URL?

On Sat, Sep 5, 2015 at 4:04 PM, webfeature notifications@github.com wrote:

Hi Vikash,

i tested it with remote files. Sorry for the incomplete description of the
problem.

Regrads,
Christian


Reply to this email directly or view it on GitHub
#3 (comment)
.

@vikash-bhardwaj
Copy link
Owner

@webfeature, I tested the above given scenario for Remote configurations as well but couldn't reproduce the problem. Validator validate the URLs overtime even if there are files with no errors in between, it doesn't skip the URLs later after error free file.

Please let me know if there is some very specific scenario that I have to look into.

Thanks
Vikash Bhardwaj

@webfeature
Copy link

Hi Vikash,

it's the same configuration as above with the index.php?id=x parameter. If i find the time, i publish an example.

Step 1 (everthing works fine):

Validation started for.. https://url/index.php?id=9
>> Validation successful..
Validation started for.. https://url/index.php?id=8
1=> "Article lacks heading. ..."                                                                                       
No of errors: 1                                                                                                                                                         
HTML Validation report generated: test/w3cErrors/urlindexphpid8_validation-report.html
Validation report generated: validation-report.json

Step 2 (page with id=8 is now valid, but it still includes error of Step 1):

Validated skipping..uiurlindexid9_tempvlidation.html
Validation started for.. https://url/index.php?id=8
>> Validation successful..
Validation report generated: validation-report.json

Step 3 (validation is skipped, but it still includes error of Step 1):

Validated skipping..uiurlindexid9_tempvlidation.html
Validated skipping..uiurlindexid8_tempvlidation.html

Between each step i execute grunt validation

Config:

 remotePath: 'url',
 remoteFiles: [
     'index.php?id=9', 'index.php?id=8'
 ],

If i delete validation-status.json everthing works fine again.

Regards,
Christian

@vikash-bhardwaj
Copy link
Owner

Hi Christian,

Thanks for the update and It will be very helpful if you can send me the local package of your files if possible else I will create the data over the week-end.

Thanks
Vikash Bhardwaj

@webfeature
Copy link

Hi Vikash,

here a configuration which produce the error:

validation: {
            options: {
                reset: grunt.option('reset') || false,
                stoponerror:false,
                relaxerror: [
                    "The Content-Type was .text/html.. Using the HTML parser.",
                    'Using the schema for HTML with SVG 1.1, MathML 3.0, RDFa 1.1, and ITS 2.0 support.',
                    'Bad value .screen,projection. *'
                ],
                remotePath: 'http://www.gut-reichenhof.de/',
                remoteFiles: [
                    'index.php?id=8', 'index.php?id=10', 'index.php?id=12'
                ],
            },
            files: {
                src: ['src/']
            }
        }

With the relaxerror option i simulate that the files (id=8 and 10) are error free. Just the file with the id=12 includes an error. When you re-run grunt validation, you get the problem i descriped above.

Regards,
Christian

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.

4 participants