Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bitbucket-copy-commit-reference: BitbucketServer: get date from REST API
Bitbucket Server has a user setting "Timestamp" with two possible values: "Relative" and "Absolute". I was testing only with "Relative", and unfortunately, the script is broken for users with "Absolute". In particular, Bitbucket Server does not store a machine-readable timestamp in HTML attributes, as I assumed. For users with "Absolute" timestamps, the HTML contains the same human-readable string as the UI part.[1] Rewrite method `getDateIso` to make it independent of the HTML -- use the REST API to fetch the data about the commit, which includes the timestamps.[2] This should not be too big of a performance hit, because we already do a similar request for pull request links. Though ideally, we would want these requests to be parallel. [1] Side note: the timestamps do not appear to be localized -- I checked German and French and both them show the date in English. [2] Unfortunately, Bitbucket does not include the timezone information, unlike Git CLI.
- Loading branch information