Commit Graph

44 Commits

Author SHA1 Message Date
Kamil Trzciński b22287f00f Make CI refs matching to to use UntrustedRegexp
This makes ref validation to use always `UntrustedRegexp`.
This also splits the existing RubySyntax into separate
class.
2019-03-15 14:38:28 +01:00
Stan Hu 6c83c2d8b9 Merge branch 'lock-trace-writes' into 'master'
Lock writes to trace stream

Closes #51502

See merge request gitlab-org/gitlab-ce!23332
2018-11-27 20:56:40 +00:00
Kamil Trzciński 31a1ce2132 Lock writes to trace stream 2018-11-27 17:55:20 +01:00
Kamil Trzciński c150772edb Fix deadlock on ChunkedIO 2018-11-26 13:15:46 +01:00
Kamil Trzciński bc00803af0 Access metadata directly from Object Storage
Previously we would pull the file, now, we just stream-it as needed from Object Storage
2018-07-09 14:19:52 +02:00
Shinya Maeda 9d6fe7bfdf Refactoring ci_job_trace to ci_build_trace 2018-04-26 15:06:04 +09:00
Shinya Maeda cffee49f7f Change Redis TTL to 1day. Fixing nitpicks 2018-04-06 19:30:23 +09:00
Shinya Maeda 4c6cb3cf06 Fix Stream#file? duplicates. And the spec 2018-04-06 15:07:55 +09:00
Shinya Maeda 7297a06cb6 Fix bunch of texts 2018-04-06 04:41:45 +09:00
Shinya Maeda 1a71dd049b Fix rubocop 2018-04-06 00:57:05 +09:00
Shinya Maeda d429099555 Add tests for Trace::Stream 2018-04-06 00:19:41 +09:00
Shinya Maeda b94c84e597 Add spec for ChunkedIO 2018-04-05 23:43:21 +09:00
Kamil Trzciński de5194cdb8 Removed unused code 2018-04-05 14:14:54 +09:00
Shinya Maeda 91fe68a6af Use bytesize everywhere instead of length 2018-04-05 14:14:54 +09:00
Shinya Maeda a689a220d3 Fix static analysys 2018-04-05 14:14:54 +09:00
Shinya Maeda 1de5b8db5a Fix Live trace 2018-04-05 14:14:54 +09:00
Shinya Maeda 3a99a6b903 Consolidate ChunkedIO 2018-04-05 14:14:54 +09:00
Shinya Maeda d1632da8c3 Implement basic live trace feature 2018-04-05 14:14:54 +09:00
Shinya Maeda 8a1c2bc474 Add tests for ChunkStore::Database too 2018-04-05 14:14:54 +09:00
Shinya Maeda 1a05c60ee6 Add spec for chunked_io 2018-04-05 14:14:53 +09:00
Shinya Maeda 1108df181c Add chunks_store database spec 2018-04-05 14:14:53 +09:00
Shinya Maeda f49aea7522 Add spec for ChunkStore::Redis 2018-04-05 14:14:53 +09:00
Micaël Bergeron 44f37504fb Backport ee-40781-os-to-ce 2018-03-22 08:49:04 -04:00
Micaël Bergeron 0e732fa466 removed EE specific code from the port 2018-03-01 11:18:37 -05:00
Alessio Caiazza 91f8e734fe
Add CI build trace sections extractor 2017-10-05 15:42:25 +02:00
Robert Speicher 4edfad9678 Enable Layout/TrailingWhitespace cop and auto-correct offenses 2017-08-15 13:44:37 -04:00
Nick Thomas 61f948baed Upgrade the re2 gem to 1.1.0 2017-07-24 11:03:37 +01:00
Nick Thomas 4bda5b502d Short-circuit build coverage extraction for empty regexes 2017-07-22 07:12:19 +01:00
Nick Thomas 000ddc96c5 Fix the gcovr coverage regex by removing line separators before scanning
RE2 differs from Ruby in handling multiple-line strings. The string "foo\n"
will not match the regular expression "foo$" unless multi-line mode is enabled
(and it's off by default).

Since we're already scanning the build trace line by line (and so multi-line
coverage regular expressions won't work), we can fix this by removing the line
separator before scanning the string.
2017-07-21 22:08:23 +01:00
Douwe Maan ba60d4f6e4 Merge branch '24570-use-re2-for-user-supplied-regexp-9-3' into 'security-9-3'
24570 use re2 for user supplied regexp 9 3

See merge request !2129
2017-07-19 22:28:41 -05:00
Shinya Maeda a6f6056c62 Use force_encoding when regex contains UTF-8 char 2017-05-24 20:10:14 +09:00
Shinya Maeda b9950c22b3 Use each_line. Avoid comparison of partial. Add UTF-8 spec. 2017-05-24 20:10:14 +09:00
Shinya Maeda 3d11b7d8e2 Fix reverse_line from chunk based 2017-05-24 20:10:14 +09:00
Shinya Maeda a1cddf051e Reproduced 2017-05-24 20:10:14 +09:00
Lin Jen-Shin b07da07c82 Just enforce the output encoding for Ansi2html
Fixes https://sentry.gitlap.com/gitlab/gitlabcom/issues/27545/
2017-04-18 17:12:06 +08:00
Lin Jen-Shin 9350b9064c Set the encoding in c'tor and explain why it's fine 2017-04-17 17:52:15 +08:00
Lin Jen-Shin f05ab97e1e Restore nil for stream 2017-04-17 17:12:43 +08:00
Lin Jen-Shin e7d3fe44f6 Only set the encoding before passing to Ansi2html 2017-04-17 17:10:41 +08:00
Lin Jen-Shin c26b126502 Make sure @stream.each_line would tag Encoding.default_external 2017-04-17 15:53:09 +08:00
Lin Jen-Shin ee3b0c3a9a Make sure we're giving Encoding.default_external 2017-04-17 14:30:42 +08:00
Lin Jen-Shin 0a3c98a7e3 Update tests for the fact that we would skip one line 2017-04-13 22:23:12 +08:00
Lin Jen-Shin faa5dffbcc After Trace#limit, we seek to the next line in case
of breaking ANSI sequence or Unicode
2017-04-13 21:44:26 +08:00
Z.J. van de Weg 23fbbe0c92 Return nil as coverage instead of a File object
Given a valid pipeline job, and a regex which wouldn't match to a jobs
trace, the stream of the trace would return the File object. This was
not the case when it matched a value, as that would have been return
from the block.

Now the `extract_coverage` method returns `nil` if no match was found.
2017-04-12 12:03:39 +02:00
Kamil Trzciński 828d81ee1f Optimise trace handling code to use streaming instead of full read 2017-04-06 16:20:27 +00:00