{"action":"created","issue":{"url":"https://api.github.com/repos/zanata/zanata-platform/issues/744","repository_url":"https://api.github.com/repos/zanata/zanata-platform","labels_url":"https://api.github.com/repos/zanata/zanata-platform/issues/744/labels{/name}","comments_url":"https://api.github.com/repos/zanata/zanata-platform/issues/744/comments","events_url":"https://api.github.com/repos/zanata/zanata-platform/issues/744/events","html_url":"https://github.com/zanata/zanata-platform/pull/744","id":303686052,"number":744,"title":"fix(ZNTA-193): prevent user exceeding maximum filename length","user":{"login":"djansen-redhat","id":4597195,"avatar_url":"https://avatars3.githubusercontent.com/u/4597195?v=4","gravatar_id":"","url":"https://api.github.com/users/djansen-redhat","html_url":"https://github.com/djansen-redhat","followers_url":"https://api.github.com/users/djansen-redhat/followers","following_url":"https://api.github.com/users/djansen-redhat/following{/other_user}","gists_url":"https://api.github.com/users/djansen-redhat/gists{/gist_id}","starred_url":"https://api.github.com/users/djansen-redhat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/djansen-redhat/subscriptions","organizations_url":"https://api.github.com/users/djansen-redhat/orgs","repos_url":"https://api.github.com/users/djansen-redhat/repos","events_url":"https://api.github.com/users/djansen-redhat/events{/privacy}","received_events_url":"https://api.github.com/users/djansen-redhat/received_events","type":"User","site_admin":false},"labels":[{"id":465778273,"url":"https://api.github.com/repos/zanata/zanata-platform/labels/Work%20in%20progress","name":"Work in progress","color":"fef2c0","default":false}],"state":"open","locked":false,"assignee":{"login":"djansen-redhat","id":4597195,"avatar_url":"https://avatars3.githubusercontent.com/u/4597195?v=4","gravatar_id":"","url":"https://api.github.com/users/djansen-redhat","html_url":"https://github.com/djansen-redhat","followers_url":"https://api.github.com/users/djansen-redhat/followers","following_url":"https://api.github.com/users/djansen-redhat/following{/other_user}","gists_url":"https://api.github.com/users/djansen-redhat/gists{/gist_id}","starred_url":"https://api.github.com/users/djansen-redhat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/djansen-redhat/subscriptions","organizations_url":"https://api.github.com/users/djansen-redhat/orgs","repos_url":"https://api.github.com/users/djansen-redhat/repos","events_url":"https://api.github.com/users/djansen-redhat/events{/privacy}","received_events_url":"https://api.github.com/users/djansen-redhat/received_events","type":"User","site_admin":false},"assignees":[{"login":"djansen-redhat","id":4597195,"avatar_url":"https://avatars3.githubusercontent.com/u/4597195?v=4","gravatar_id":"","url":"https://api.github.com/users/djansen-redhat","html_url":"https://github.com/djansen-redhat","followers_url":"https://api.github.com/users/djansen-redhat/followers","following_url":"https://api.github.com/users/djansen-redhat/following{/other_user}","gists_url":"https://api.github.com/users/djansen-redhat/gists{/gist_id}","starred_url":"https://api.github.com/users/djansen-redhat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/djansen-redhat/subscriptions","organizations_url":"https://api.github.com/users/djansen-redhat/orgs","repos_url":"https://api.github.com/users/djansen-redhat/repos","events_url":"https://api.github.com/users/djansen-redhat/events{/privacy}","received_events_url":"https://api.github.com/users/djansen-redhat/received_events","type":"User","site_admin":false}],"milestone":null,"comments":8,"created_at":"2018-03-09T00:50:04Z","updated_at":"2018-03-09T04:59:41Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/zanata/zanata-platform/pulls/744","html_url":"https://github.com/zanata/zanata-platform/pull/744","diff_url":"https://github.com/zanata/zanata-platform/pull/744.diff","patch_url":"https://github.com/zanata/zanata-platform/pull/744.patch"},"body":"JIRA issue URL: https://zanata.atlassian.net/browse/ZNTA-193\r\n\r\nPrevent a user specifying a file path exceeding the standard 255 characters.\r\n\r\n## Checklist\r\n\r\n- JIRA link\r\n- Check target branch\r\n- Make sure all commit statuses are green or otherwise documented reasons to ignore\r\n- QA needs to evaluate against the JIRA ticket\r\n- Changed files and commits make sense for this PR\r\n\r\nSee [Zanata Development Guidelines](https://github.com/zanata/zanata-platform/wiki/Development-Guidelines) more for information.\r\n\r\n----\r\n*This template can be updated in .github/PULL_REQUEST_TEMPLATE.md*\r\n"},"comment":{"url":"https://api.github.com/repos/zanata/zanata-platform/issues/comments/371713917","html_url":"https://github.com/zanata/zanata-platform/pull/744#issuecomment-371713917","issue_url":"https://api.github.com/repos/zanata/zanata-platform/issues/744","id":371713917,"user":{"login":"seanf","id":54155,"avatar_url":"https://avatars0.githubusercontent.com/u/54155?v=4","gravatar_id":"","url":"https://api.github.com/users/seanf","html_url":"https://github.com/seanf","followers_url":"https://api.github.com/users/seanf/followers","following_url":"https://api.github.com/users/seanf/following{/other_user}","gists_url":"https://api.github.com/users/seanf/gists{/gist_id}","starred_url":"https://api.github.com/users/seanf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seanf/subscriptions","organizations_url":"https://api.github.com/users/seanf/orgs","repos_url":"https://api.github.com/users/seanf/repos","events_url":"https://api.github.com/users/seanf/events{/privacy}","received_events_url":"https://api.github.com/users/seanf/received_events","type":"User","site_admin":false},"created_at":"2018-03-09T04:59:41Z","updated_at":"2018-03-09T04:59:41Z","author_association":"OWNER","body":"@djansen-redhat \r\n\r\n> @seanf so I guess the db limit (confirmed varchar255) was arbitrarily chosen.\r\n\r\nI think so. I'm not sure if anyone (other than you) has run into the limit yet though. (Some Java programmer might, with .properties in a deep source tree.)\r\n\r\n> Is the fix now \r\n> - increase that limit to something like 4098 - 255, \r\n> - a considerable limit with a \"yeah we don't support anything beyond this'\r\n> - 4097 characters with smarts to work out if files breach that limit before upload?\r\n\r\nIf we were to increase the limits, I would try to match Linux's limits (255 and 4095).\r\n\r\n> - (edit) keep what we have now and just let them fail but with a better error\r\n\r\nI'm never sure what to do about redundant validation problems like this. (For example, GWT was designed to let us re-use the server-side annotation-based bean validators on the client side.) If you do nothing in the client, the limit will still be enforced somewhere, but you might not get a nice error message, and it might not happen until you commit. Probably leading to a very ugly error message, depending on how we handle it.\r\n\r\nI don't really like the idea of redundantly specifying the limits so many times (eg how to make sure they stay in sync?):\r\n\r\n1. In the DB schema (AND the Hibernate/JPA annotations like `@Column length`, because we can't sync them with Liquibase yet.)\r\n2. In the Hibernate entity's bean validation annotations like `@Size`\r\n3. On the client-side (eg JavaScript for the browser, or zanata-cli)\r\n\r\nBut I suppose it's the only way to give timely error messages to the user. It seems like we ought be passing the limits from the bean validation annotations down to the client somehow (eg shared constants, or runtime queries against the annotations). But I'm sure that's a much bigger problem than you wanted to tackle. I suppose it would suffice to put comments in each location, to help us keep them in sync if they ever change.\r\n\r\nI think if we put the filename/path limits as constants into zanata-common-api, we should be able to use them from the annotations `@Column length`, `@Size` and also from the zanata-cli code. However, it's probably okay for zanata-cli just to ignore the limits, and handle the validation error when it comes back from the server. (In practice, the client will probably be unable to generate excessive filenames due to filesystem limitations, assuming we increase Zanata's limits to match Linux. Unless the client is using filename mapping to complicate things...) That's assuming the server is returning a meaningful error, and not a 500 code or something."}}
{"actor":{"display_login":"seanf"}}