Dataset Viewer
Auto-converted to Parquet
hash
stringlengths
16
16
value
dict
prompt
listlengths
12
12
033b0baff52bb483
{ "callgraph": "[FindFiles->[Builder->[asOfTime->[inSnapshot],inPartitions->[inPartitions]]]]", "msg": "If there are no manifests, then entries should be `CloseableIterable.empty()`, not the manifest iterable. That doesn't need to be closeable.", "patch": "@@ -191,7 +191,10 @@ public class FindFiles {\n Snapshot snapshot = snapshotId != null ?\n ops.current().snapshot(snapshotId) : ops.current().currentSnapshot();\n \n- CloseableIterable<ManifestEntry> entries = new ManifestGroup(ops, snapshot.manifests())\n+ // snapshot could be null when the table just gets created\n+ Iterable<ManifestFile> manifests = (snapshot != null) ? snapshot.manifests() : CloseableIterable.empty();\n+\n+ CloseableIterable<ManifestEntry> entries = new ManifestGroup(ops, manifests)\n .filterData(rowFilter)\n .filterFiles(fileFilter)\n .filterPartitions(partitionFilter)", "summary": "Collect all data files in the manifest." }
[ { "content": "Please Give FORMAL Codereview for software developers in one sentence from the given diff hunk. Don’t start with Codereview/review. Just give the answer. Five examples are given before with code and code review and the code to work on is given after.", "role": "user" }, { "content": "Code: \t@@ -98,7 +98,7 @@ public class IndexSpec\n Preconditions.checkArgument(metricCompression == null || COMPRESSION_NAMES.contains(metricCompression),\n \"Unknown compression type[%s]\", metricCompression);\n \n- this.bitmapSerdeFactory = bitmapSerdeFactory != null ? bitmapSerdeFactory : IndexIO.CONFIGURED_BITMAP_SERDE_FACTORY;\n+ this.bitmapSerdeFactory = bitmapSerdeFactory != null ? bitmapSerdeFactory : new ConciseBitmapSerdeFactory();\n this.metricCompression = metricCompression;\n this.dimensionCompression = dimensionCompression;\n }\n\nCallgraph: \t[IndexSpec->[hashCode->[hashCode],equals->[equals]]]\nCodereview: ", "role": "user" }, { "content": "Does this mean `druid.processing.bitmap.type` will no longer work to set the default bitmap type? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -202,6 +202,16 @@ public class CompactionTask extends AbstractBatchIndexTask\n this.dimensionsSpec = dimensionsSpec == null ? dimensions : dimensionsSpec;\n this.metricsSpec = metricsSpec;\n this.segmentGranularity = segmentGranularity;\n+ if (granularitySpec == null && segmentGranularity != null) {\n+ this.granularitySpec = new UniformGranularitySpec(\n+ segmentGranularity,\n+ null,\n+ null,\n+ null\n+ );\n+ } else {\n+ this.granularitySpec = granularitySpec;\n+ }\n this.tuningConfig = tuningConfig != null ? getTuningConfig(tuningConfig) : null;\n this.segmentProvider = new SegmentProvider(dataSource, this.ioConfig.getInputSpec());\n this.partitionConfigurationManager = new PartitionConfigurationManager(this.tuningConfig);\n\nCallgraph: \t[CompactionTask->[createContextForSubtask->[getPriority],createDimensionsSpec->[getType],Builder->[build->[CompactionTask]],runTask->[isReady]]]\nCodereview: ", "role": "user" }, { "content": "What happens if both segmentGranularity & granularitySpec are non-null? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -40,7 +40,7 @@ public class ArrayConcat {\n }\n final int leftSize = left != null ? left.size() : 0;\n final int rightSize = right != null ? right.size() : 0;\n- final List<T> result = new ArrayList(leftSize + rightSize);\n+ final List<T> result = new ArrayList<>(leftSize + rightSize);\n if (left != null) {\n result.addAll(left);\n }\n\nCallgraph: \t[ArrayConcat->[concat->[ArrayList,addAll,size]]]\nCodereview: ", "role": "user" }, { "content": "Minor side improvement to get rid or compiler warning. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -391,7 +391,9 @@ public class HoodieDeltaStreamer implements Serializable {\n ValidationUtils.checkArgument(!cfg.filterDupes || cfg.operation != Operation.UPSERT,\n \"'--filter-dupes' needs to be disabled when '--op' is 'UPSERT' to ensure updates are not missed.\");\n \n- this.props = properties != null ? properties : UtilHelpers.readConfig(fs, new Path(cfg.propsFilePath), cfg.configs).getConfig();\n+ this.props = properties != null ? properties : UtilHelpers.readConfig(\n+ FSUtils.getFs(cfg.propsFilePath, jssc.hadoopConfiguration()),\n+ new Path(cfg.propsFilePath), cfg.configs).getConfig();\n LOG.info(\"Creating delta streamer with configs : \" + props.toString());\n this.schemaProvider = UtilHelpers.createSchemaProvider(cfg.schemaProviderClassName, props, jssc);\n \n\nCallgraph: \t[HoodieDeltaStreamer->[DeltaSyncService->[startService->[isAsyncCompactionEnabled],onInitializingWriteClient->[isAsyncCompactionEnabled],close->[close]],main->[sync,Config]]]\nCodereview: ", "role": "user" }, { "content": "Let us make it flexible in HoodieMultiTableDeltaStreamer as well? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -73,7 +73,14 @@ public class ExprUtils\n } else {\n Chronology chronology = timeZone == null ? ISOChronology.getInstanceUTC() : ISOChronology.getInstance(timeZone);\n final Object value = originArg.eval(bindings).value();\n- origin = value != null ? new DateTime(value, chronology) : null;\n+ if (value instanceof String && StringUtils.isEmpty((String) value)) {\n+ // We get a blank string here, when sql compatible null handling is enabled\n+ // and expression contains empty string for for origin\n+ // e.g timestamp_floor(\\\"__time\\\",'PT1M','','UTC')\n+ origin = null;\n+ } else {\n+ origin = value != null ? new DateTime(value, chronology) : null;\n+ }\n }\n \n return new PeriodGranularity(period, origin, timeZone);\n\nCallgraph: \t[ExprUtils->[toTimeZone->[isLiteral,getLiteralValue,IAE,inferTzfromString],toPeriodGranularity->[value,inferTzfromString,getInstance,getInstanceUTC,DateTime,PeriodGranularity,asString,Period]]]\nCodereview: ", "role": "user" }, { "content": "This `StringUtils.isEmpty()` is a dangerously-named synonym of `isNullOrEmpty()`, although it won't make difference here, because of the `value instanceof String` check guaranteeing that the value is not null. Please prohibit this whole `org.apache.commons.lang.StringUtils` class on forbidden-apis level. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -191,7 +191,10 @@ public class FindFiles {\n Snapshot snapshot = snapshotId != null ?\n ops.current().snapshot(snapshotId) : ops.current().currentSnapshot();\n \n- CloseableIterable<ManifestEntry> entries = new ManifestGroup(ops, snapshot.manifests())\n+ // snapshot could be null when the table just gets created\n+ Iterable<ManifestFile> manifests = (snapshot != null) ? snapshot.manifests() : CloseableIterable.empty();\n+\n+ CloseableIterable<ManifestEntry> entries = new ManifestGroup(ops, manifests)\n .filterData(rowFilter)\n .filterFiles(fileFilter)\n .filterPartitions(partitionFilter)\nCallgraph: \t[FindFiles->[Builder->[asOfTime->[inSnapshot],inPartitions->[inPartitions]]]]\nCodereview: ", "role": "user" } ]
c1752542d5b833d3
{ "callgraph": "[OpenTelemetryProtocolExporterEventSource->[FailedToReachCollector->[FailedToReachCollector],ExportMethodException->[ExportMethodException]]]", "msg": "Didn't went with backwards compatibility since it's still in beta", "patch": "@@ -26,11 +26,12 @@ namespace OpenTelemetry.Exporter.OpenTelemetryProtocol.Implementation\n public static readonly OpenTelemetryProtocolExporterEventSource Log = new OpenTelemetryProtocolExporterEventSource();\n \n [NonEvent]\n- public void FailedToReachCollector(Exception ex)\n+ public void FailedToReachCollector(Uri collectorUri, Exception ex)\n {\n if (Log.IsEnabled(EventLevel.Error, EventKeywords.All))\n {\n- this.FailedToReachCollector(ex.ToInvariantString());\n+ var rawCollectorUri = collectorUri.ToString();\n+ this.FailedToReachCollector(rawCollectorUri, ex.ToInvariantString());\n }\n }\n ", "summary": "FailedToReachCollector - Method failed to reach collector." }
[ { "content": "Please Give FORMAL Codereview for software developers in one sentence from the given diff hunk. Don’t start with Codereview/review. Just give the answer. Five examples are given before with code and code review and the code to work on is given after.", "role": "user" }, { "content": "Code: \t@@ -194,8 +194,9 @@ namespace System.Text.Json\n }\n }\n \n+ [DoesNotReturn]\n [MethodImpl(MethodImplOptions.NoInlining)]\n- public static void ReThrowWithPath(in WriteStack writeStack, Exception ex)\n+ public static void ReThrowWithPath(in WriteStack writeStack, Exception? ex)\n {\n JsonException jsonException = new JsonException(null, ex);\n AddExceptionInformation(writeStack, jsonException);\n\nCallgraph: \t[ThrowHelper->[ReThrowWithPath->[AddExceptionInformation]]]\nCodereview: ", "role": "user" }, { "content": "Same here. Remove nullability annotation? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -26,11 +26,12 @@ public class SynchronousUntilSuccessfulProcessingStrategy extends AbstractUntilS\n protected transient Log logger = LogFactory.getLog(getClass());\n \n @Override\n- public MuleEvent route(MuleEvent event) throws MessagingException\n+ protected MuleEvent doRoute(MuleEvent event) throws MessagingException\n {\n Exception lastExecutionException = null;\n try\n {\n+ MuleEvent retryEvent = DefaultMuleEvent.copy(event);\n for (int i = 0; i <= getUntilSuccessfulConfiguration().getMaxRetries(); i++)\n {\n try\n\nCallgraph: \t[SynchronousUntilSuccessfulProcessingStrategy->[initialise->[InitialisationException,getThreadingProfile,createStaticMessage,getDlqMP,getObjectStore],route->[getMessage,processEvent,debug,sleep,RoutingException,processResponseThroughAckResponseExpression,getMillisBetweenRetries,isDebugEnabled,info,getMaxRetries,getRouter],getLog,getClass]]\nCodereview: ", "role": "user" }, { "content": "if this is a copy then this is not the originalEvent </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -5222,7 +5222,7 @@ namespace System.Tests\n }\n \n [Fact]\n- public static void ToLower()\n+ public static void ToLower_2()\n {\n var expectedSource = new char[3] { 'a', 'B', 'c' };\n var expectedDestination = new char[3] { 'a', 'b', 'c' };\n\nCallgraph: \t[StringTests->[PadRight->[PadRight],IndexOfAny_InvalidCount_ThrowsArgumentOutOfRangeException->[IndexOfAny],IsNullOrEmpty->[IsNullOrEmpty],LastIndexOfSequenceZeroLengthValue_Char->[Length],ToLowerInvariant->[ToLowerInvariant,Length],SameValueCompareTo_StringComparison->[Compare],IndexOfAny_NullAnyOf_ThrowsArgumentNullException->[IndexOfAny],ZeroLengthEndsWith_StringComparison->[EndsWith],ToString->[ToString],SameSpanContains_StringComparison->[Contains],SequenceCompareToNoMatch_Char->[Compare],TrimCharacterAtEnd->[Trim,TrimEnd,TrimStart],MakeSureNoCompareToChecksGoOutOfRange_StringComparison->[Compare],CompareTest->[Compare,Length],Insert_Invalid->[Insert],LengthMismatchToLower->[ToLower,ToLowerInvariant,Length],Equals->[Equals],TrimCharactersInMiddle->[Length,Trim,ToCharArray,TrimEnd,TrimStart],OnlyWhiteSpaceTrim->[Trim,TrimEnd,TrimStart],Equals_InvalidComparisonType_ThrowsArgumentOutOfRangeException->[Equals],EndsWithMatchNonOrdinal_StringComparison->[EndsWith],NoWhiteSpaceTrim->[Trim,TrimEnd,TrimStart],Compare_Invalid->[Compare],ToUpper_TurkishI_InvariantCulture->[ToString,Equals,ToUpper,Length],StartsWithNoMatch_StringComparison->[StartsWith,ToString],OnlyTrimCharacters->[Length,Trim,ToCharArray,TrimEnd,TrimStart],CopyTo->[Length,CopyTo],ToCharArray_Invalid->[ToCharArray],TrimCharactersAtEnd->[ToCharArray,Trim,TrimEnd,TrimStart],ToUpper_TurkishI_EnglishUSCulture_MemberData->[ToUpper_TurkishI_MemberData],LengthMismatchStartsWith_Char->[StartsWith],LengthMismatchStartsWith_StringComparison->[StartsWith],TrimEnd->[ToString,TrimEnd,Length],WhiteSpaceAtEndTrim->[Trim,TrimEnd,TrimStart],ZeroLengthEndsWith_Char->[EndsWith],LastIndexOfAny->[LastIndexOfAny,Length],Remove_Invalid->[Remove,Length],IsWhiteSpaceFalse->[Length],ToUpperInvariant->[ToString,ToUpperInvariant,Length],MakeSureNoContainsChecksGoOutOfRange_StringComparison->[Contains],WhiteSpaceInMiddleTrim->[Trim,TrimEnd,TrimStart],StartEndWithTest->[StartsWith,EndsWith],Permute->[Length,Permute],Remove->[Remove,Length],SameSpanStartsWith_StringComparison->[StartsWith],ToUpper_TurkishI_EnglishUSCulture->[ToString,Equals,ToUpper,Length],EndsWithNoMatchNonOrdinal_StringComparison->[EndsWith],MakeSureNoSequenceCompareToChecksGoOutOfRange_Char->[Compare],MakeSureNoEndsWithChecksGoOutOfRange_StringComparison->[EndsWith],StartsWithMatch_StringComparison->[StartsWith],MakeSureNoTrimChecksGoOutOfRange->[Trim,TrimEnd,TrimStart],GetEnumerator_Generic->[Length],ZeroLengthTrimCharacters->[ToCharArray,Trim,TrimEnd,TrimStart],Length->[Length],GetEnumeratorTest->[Length],SameSpanEndsWith_Char->[EndsWith],Insert->[Insert],CompareToNoMatch_StringComparison->[Compare],StartsWithMatchDifferentSpans_StringComparison->[StartsWith],ContainsMatch_StringComparison->[Contains],AllSubstringsAndComparisons->[Substring,Length],EndsWithMatch_Char->[EndsWith],MakeSureNoToUpperChecksGoOutOfRange->[ToCharArray,ToUpper,Length],ToUpper_TurkishI_InvariantCulture_MemberData->[ToUpper_TurkishI_MemberData],GetEnumerator_NonGeneric->[Length],LastIndexOf_Invalid->[Length],IndexOf_SingleLetter->[Length],MakeSureNoStartsWithChecksGoOutOfRange_Char->[StartsWith],MakeSureNoTrimCharacterChecksGoOutOfRange->[Trim,TrimEnd,TrimStart],StartEndNegativeTest->[StartsWith,EndsWith],EndsWith_Invalid->[EndsWith],StartsWith_Invalid->[StartsWith],LengthMismatchContains_StringComparison->[Contains],Contains_NullValue_ThrowsArgumentNullException->[Contains],Test_ToLower_Culture->[ToLower_Culture_TestData],IsWhiteSpaceTrueLatin1->[Length],OnlyTrimCharacter->[Trim,TrimEnd,TrimStart],EndsWithNoMatch_Char->[EndsWith],SameSpanStartsWith_Char->[StartsWith],ToUpper_TurkishI_TurkishCulture_MemberData->[ToUpper_TurkishI_MemberData],StartsWithNoMatch_Char->[StartsWith],ZeroLengthStartsWith_Char->[StartsWith],StartsWith_NullInStrings_NonOrdinal->[StartsWith],CompareToMatchDifferentInstances_StringComparison->[Compare],EndsWith_NullInStrings->[EndsWith],IsSafeForCurrentCultureComparisons->[Length],MakeSureNoTrimCharactersChecksGoOutOfRange->[Length,Substring,Trim,ToCharArray,TrimEnd,TrimStart],LastIndexOfAny_Invalid->[LastIndexOfAny],StartsWith_NullInStrings->[StartsWith],ZeroLengthCompareTo_StringComparison->[Compare],TrimCharacterAtStartAndEnd->[Trim,TrimEnd,TrimStart],ToCharArray->[ToCharArray,Length],TrimCharactersAtStart->[ToCharArray,Trim,TrimEnd,TrimStart],Format_Invalid->[Format],InternTest->[ToString,Equals],ZeroLengthStartsWith_StringComparison->[StartsWith],ContainsNoMatch_StringComparison->[Contains],Join_StringArray->[Length],ToLower->[ToCharArray,ToLowerInvariant,ToLower,Length],ToLower_Culture->[Equals,ToLower,Length],CompareToUnknownComparisonType_StringComparison->[Compare],LengthMismatchEndsWith_StringComparison->[EndsWith],EndsWithMatchDifferentSpans_StringComparison->[EndsWith],IndexOfAny_InvalidStartIndex_ThrowsArgumentOutOfRangeException->[IndexOfAny],TrimCharactersAtStartAndEnd->[ToCharArray,Trim,TrimEnd,TrimStart],ToLowerToUpperInvariant_ASCII->[ToString,ToLowerInvariant,ToUpperInvariant,Length],ToUpper_TurkishI_TurkishCulture->[ToString,Equals,ToUpper,Length],PadLeft->[PadLeft],PadRight_NegativeTotalWidth_ThrowsArgumentOutOfRangeException->[PadRight],CopyTo_Invalid->[Length,CopyTo],StartsWithUnknownComparisonType_StringComparison->[StartsWith],IndexOf_AllSubstrings->[Length],EndsWithMatch_StringComparison->[EndsWith],LengthMismatchEndsWith_Char->[EndsWith],ZeroLengthContains_StringComparison->[Contains],ZeroLengthToUpper->[Length],TrimCharacterMultipleTimes->[Trim,TrimEnd,TrimStart],Contains->[Contains],Concat_Objects->[Length],ContainsMatchDifferentSpans_StringComparison->[Contains],EndsWith_StringBoolCultureInfo_Valid->[EndsWith],EndsWith_NullInStrings_NonOrdinal->[EndsWith],Substring_Invalid->[Substring],IConvertible_ValuesRoundtripThroughString->[ToString],NoTrimCharacter->[Trim,TrimEnd,TrimStart],IndexOfAny->[IndexOfAny,Length],TrimCharactersMultipleTimes->[ToCharArray,Trim,TrimEnd,TrimStart],ZeroLengthToLower->[ToLower,ToLowerInvariant,Length],Ctor_SByte->[Length],SameSpanToLower->[ToLower,ToLowerInvariant],Format->[Format],PadLeft_NegativeTotalWidth_ThrowsArgumentOutOfRangeException->[PadLeft],TrimCharacterInMiddle->[Trim,TrimEnd,TrimStart],MakeSureNoToLowerChecksGoOutOfRange->[ToCharArray,ToLowerInvariant,ToLower,Length],TrimStart->[ToString,Length,TrimStart],CompareToOverlappingMatch_StringComparison->[Compare],TrimWhiteSpaceMultipleTimes->[Trim,TrimEnd,TrimStart],Test_ToUpper_Culture->[ToUpper,Length],WhiteSpaceAtStartTrim->[Trim,TrimEnd,TrimStart],Compare->[Compare,Length],Trim->[ToString,Trim,Length],SequenceCompareToWithSingleMismatch_Char->[Compare],LastIndexOf_AllSubstrings->[Length],LengthMismatchToUpper->[Length],StartsWithMatch_Char->[StartsWith],ToLowerOverlapping->[ToLower,ToLowerInvariant],StartsWithNoMatchNonOrdinal_StringComparison->[StartsWith],NoTrimCharacters->[ToCharArray,Trim,TrimEnd,TrimStart],StartsWith->[StartsWith],EndsWithNoMatch_StringComparison->[EndsWith],StartsWithMatchDifferentSpans_Char->[StartsWith],WhiteSpaceAtStartAndEndTrim->[Trim,TrimEnd,TrimStart],IsWhiteSpaceTrue->[Length],StartsWithMatchNonOrdinal_StringComparison->[StartsWith,ToString],LengthMismatchCompareTo_StringComparison->[Compare],LastIndexOf_SingleLetter->[Length],SameSpanEndsWith_StringComparison->[EndsWith],EndsWithUnknownComparisonType_StringComparison->[EndsWith],ZeroLengthTrimCharacter->[Trim,TrimEnd,TrimStart],EndsWithMatchDifferentSpans_Char->[EndsWith],MakeSureNoEndsWithChecksGoOutOfRange_Char->[EndsWith],MakeSureNoStartsWithChecksGoOutOfRange_StringComparison->[StartsWith],Concat_String->[Length],Substring->[Substring,Length],CasingTest->[ToString,ToLower,Length,ToUpper],TrimCharacterAtStart->[Trim,TrimEnd,TrimStart],EndsWith->[EndsWith],ToUpper->[ToCharArray,ToString,ToUpper,Length],ZeroLengthTrim->[Trim,TrimEnd,TrimStart],Compare_LongString->[Compare],Equals_Encyclopaedia_ReturnsExpected->[Equals]]]\nCodereview: ", "role": "user" }, { "content": "What is the other ToLower test this is conflicting with? \"ToLower_2\" isn't descriptive about what makes this test different from a presumed \"ToLower_1\", so we should either pick descriptive names or combine the tests. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -41,9 +41,9 @@ namespace System.Collections.Tests\n #region Constructors\n \n [Fact]\n- public void PriorityQueue_Generic_Constructor()\n+ public void PriorityQueue_DefaultConstructor_ComparerEqualsDefaultComparer()\n {\n- var queue = new PriorityQueue<TElement, TPriority>();\n+ var queue = new PriorityQueue<TPriority, TPriority>();\n \n Assert.Equal(expected: 0, queue.Count);\n Assert.Empty(queue.UnorderedItems);\n\nCallgraph: \t[PriorityQueue_Generic_Tests->[PriorityQueue_Enumeration_InvalidationOnModifiedCapacity->[GenericPriorityQueueFactory,GetUnderlyingBufferCapacity],PriorityQueue_Generic_PeekAndDequeue->[GenericPriorityQueueFactory],PriorityQueue_Generic_TrimExcess_Repeatedly->[GenericPriorityQueueFactory],PriorityQueue_Generic_Clear->[GenericPriorityQueueFactory],PriorityQueue_Generic_Enqueue->[GenericPriorityQueueFactory],PriorityQueue_Enumeration_OrderingIsConsistent->[GenericPriorityQueueFactory],PriorityQueue_Generic_TrimExcess_ValidQueueThatHasntBeenRemovedFrom->[GenericPriorityQueueFactory]]]\nCodereview: ", "role": "user" }, { "content": "Was this a purposeful change? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -64,13 +64,13 @@ public class TestMemoryDirectory extends NXRuntimeTestCase {\n static final String SCHEMA_NAME = \"myschema\";\n \n @Override\n- @Before\n public void setUp() throws Exception {\n- super.setUp();\n-\n deployBundle(\"org.nuxeo.ecm.core.schema\");\n deployContrib(\"org.nuxeo.ecm.directory.core.tests\", \"test-schema.xml\");\n+ }\n \n+ @Override\n+ protected void postSetUp() throws Exception {\n MemoryDirectoryDescriptor descr = new MemoryDirectoryDescriptor();\n descr.name = \"mydir\";\n descr.schemaName = SCHEMA_NAME;\n\nCallgraph: \t[TestMemoryDirectory->[testOrderBy->[entryIds],setUp->[setUp]]]\nCodereview: ", "role": "user" }, { "content": "- use of `deployContrib` with a test contribution </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -26,11 +26,12 @@ namespace OpenTelemetry.Exporter.OpenTelemetryProtocol.Implementation\n public static readonly OpenTelemetryProtocolExporterEventSource Log = new OpenTelemetryProtocolExporterEventSource();\n \n [NonEvent]\n- public void FailedToReachCollector(Exception ex)\n+ public void FailedToReachCollector(Uri collectorUri, Exception ex)\n {\n if (Log.IsEnabled(EventLevel.Error, EventKeywords.All))\n {\n- this.FailedToReachCollector(ex.ToInvariantString());\n+ var rawCollectorUri = collectorUri.ToString();\n+ this.FailedToReachCollector(rawCollectorUri, ex.ToInvariantString());\n }\n }\n \nCallgraph: \t[OpenTelemetryProtocolExporterEventSource->[FailedToReachCollector->[FailedToReachCollector],ExportMethodException->[ExportMethodException]]]\nCodereview: ", "role": "user" } ]
7dc3d2474c83cca7
{ "callgraph": "[replace,fieldRow,dispose,isShadow,utils,outputConnection,setAttribute,substring,name,Colours,stringify,map,require,WidgetDiv,DUMMY_INPUT,FieldTextInputRemovable,setCheck,provide,setShadow,Blocks,render,dom,setFieldValue,initSvg,appendChild,ScratchBlocks,parse,connection,INPUT_VALUE,Events,trim,type,getField,getFieldValue,getAttribute,createElement]", "msg": "Is this actually a lint related change?", "patch": "@@ -185,7 +185,7 @@ Blockly.ScratchBlocks.ProcedureUtils.removeAllInputs_ = function() {\n */\n Blockly.ScratchBlocks.ProcedureUtils.createAllInputs_ = function(connectionMap) {\n // Split the proc into components, by %n, %b, and %s (ignoring escaped).\n- var procComponents = this.procCode_.split(/(?=[^\\\\]\\%[nbs])/);\n+ var procComponents = this.procCode_.split(/(?=[^\\\\]%[nbs])/);\n procComponents = procComponents.map(function(c) {\n return c.trim(); // Strip whitespace.\n });", "summary": "Creates all inputs of a block and removes all inputs on the block including dummy inputs. function to populate the input." }
[ { "content": "Please Give FORMAL Codereview for software developers in one sentence from the given diff hunk. Don’t start with Codereview/review. Just give the answer. Five examples are given before with code and code review and the code to work on is given after.", "role": "user" }, { "content": "Code: \t@@ -329,7 +329,7 @@ define([\n iso8601String = iso8601String.replace(',', '.');\n \n //Split the string into its date and time components, denoted by a mandatory T\n- var tokens = iso8601String.split('T'), year, month = 1, day = 1, hours = 0, minutes = 0, seconds = 0, milliseconds = 0;\n+ var tokens = iso8601String.split('T'), year, month = 1, day = 1, hour = 0, minute = 0, second = 0, millisecond = 0;\n \n //Lacking a time is okay, but a missing date is illegal.\n var date = tokens[0];\n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "I know it's kind of verbose, but we generally avoid multi-variable var statements like this, especially when there's initialization scattered throughout. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -21,10 +21,14 @@ var $buo = function() {\n document.getElementsByTagName('body')[0].classList.add(\"crawler\");\n var mainElement = document.getElementById(\"main\");\n var noscriptElements = document.getElementsByTagName(\"noscript\");\n- // noscriptElements[0].innerHTML contains encoded HTML\n- var innerHTML = noscriptElements[0].childNodes[0].nodeValue;\n- mainElement.innerHTML = innerHTML;\n-\n+ // find the element with the \"data-path\" attribute set\n+ for (var i = 0; i < noscriptElements.length; ++i) {\n+ if (noscriptElements[i].dataset[\"path\"]) {\n+ // noscriptElements[i].innerHTML contains encoded HTML\n+ mainElement.innerHTML = noscriptElements[i].childNodes[0].nodeValue;\n+ break;\n+ }\n+ }\n // retrieve localized browser upgrade text\n var t = <%= \"'\" + I18n.t('js.browser_update') + \"'\" %>;\n \n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "How is this a `find`? Looks like you're just iterating over all the items? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -25,13 +25,13 @@ searchDataRequest.onload = function() {\n searchData.forEach(function(page) {\n index.add(page);\n });\n- postMessage({ e: 'index-ready' });\n+ postMessage({e: 'index-ready'});\n };\n searchDataRequest.open('GET', 'search-data.json');\n searchDataRequest.send();\n \n // The worker receives a message everytime the web app wants to query the index\n-onmessage = function(oEvent) {\n+self.onmessage = function(oEvent) {\n var q = oEvent.data.q;\n var hits = index.search(q);\n var results = [];\n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "Ooc, couldn't this also be `self.postMessage`? Is there any reason why you usd it below but not here (just being curious)? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -348,6 +348,7 @@ function shallowClearAndCopy(src, dst) {\n */\n angular.module('ngResource', ['ng']).\n provider('$resource', function() {\n+ var PROTOCOL_AND_DOMAIN_REGEX = /^http(?:s)?:\\/\\/[^\\/]*/;\n var provider = this;\n \n this.defaults = {\n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "Why not `(?:s)?` --> `s?` ? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -192,7 +192,7 @@ describe('injector', function() {\n \n \n it('should create $inject', function() {\n- var extraParans = angular.noop;\n+ var extraParams = angular.noop;\n /* eslint-disable space-before-function-paren */\n // keep the multi-line to make sure we can handle it\n function $f_n0 /*\n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "It took me a long time to try to decide if this should be `extraParams` or `extraParens`, the initial commit was not remotely helpful. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -185,7 +185,7 @@ Blockly.ScratchBlocks.ProcedureUtils.removeAllInputs_ = function() {\n */\n Blockly.ScratchBlocks.ProcedureUtils.createAllInputs_ = function(connectionMap) {\n // Split the proc into components, by %n, %b, and %s (ignoring escaped).\n- var procComponents = this.procCode_.split(/(?=[^\\\\]\\%[nbs])/);\n+ var procComponents = this.procCode_.split(/(?=[^\\\\]%[nbs])/);\n procComponents = procComponents.map(function(c) {\n return c.trim(); // Strip whitespace.\n });\nCallgraph: \t[replace,fieldRow,dispose,isShadow,utils,outputConnection,setAttribute,substring,name,Colours,stringify,map,require,WidgetDiv,DUMMY_INPUT,FieldTextInputRemovable,setCheck,provide,setShadow,Blocks,render,dom,setFieldValue,initSvg,appendChild,ScratchBlocks,parse,connection,INPUT_VALUE,Events,trim,type,getField,getFieldValue,getAttribute,createElement]\nCodereview: ", "role": "user" } ]
973d5f8f3c42730f
{ "callgraph": "[RefactoringChecker->[_check_superfluous_else_raise->[_check_superfluous_else],process_tokens->[_is_trailing_comma],_check_nested_blocks->[_is_actual_elif],_check_chained_comparison->[_find_lower_upper_bounds],visit_with->[_check_redefined_argument_from_local],_check_consider_merging_isinstance->[_duplicated_isinstance_types],__init__->[__init__],visit_if->[_check_superfluous_else_raise,_check_superfluous_else_return,_check_simplifiable_if,_check_consider_get],_check_swap_variables->[_is_simple_assignment],visit_assign->[_check_swap_variables],_check_superfluous_else->[_is_actual_elif,_if_statement_is_always_returning],visit_excepthandler->[_check_redefined_argument_from_local],leave_module->[_init],visit_augassign->[_check_consider_using_join],visit_for->[_check_redefined_argument_from_local],_is_node_return_ended->[_is_node_return_ended],visit_boolop->[_check_chained_comparison,_check_consider_using_in,_check_consider_merging_isinstance],visit_call->[_check_consider_using_comprehension_constructor],_check_simplifiable_if->[_is_actual_elif,_is_bool_const],_check_superfluous_else_return->[_check_superfluous_else],_check_raising_stopiteration_in_generator_next_call->[_looks_like_infinite_iterator],_check_consider_get->[type_and_name_are_equal]],RecommandationChecker->[visit_for->[_is_constant_zero,_is_builtin]],_is_trailing_comma->[get_curline_index_start],LenChecker->[visit_call->[_is_len_call,_node_is_test_condition],visit_unaryop->[_is_len_call]],register->[RefactoringChecker,RecommandationChecker,NotChecker,LenChecker]]", "msg": "I don't know if there are strict conventions about this, but I think the name of the warning should be the diagnosis, not the suggested course of action. In this case, that would mean changing the name of the warning to `interactive-exit` or something like that.", "patch": "@@ -273,6 +273,11 @@ class RefactoringChecker(checkers.BaseTokenChecker):\n \"consider using the list, dict or set constructor. \"\n \"It is faster and simpler.\",\n ),\n+ \"R1722\": (\n+ \"Consider using sys.exit()\",\n+ \"consider-using-sys-exit\",\n+ \"Instead of using exit() or quit(), consider using the sys.exit().\",\n+ ),\n }\n options = (\n (", "summary": "Uses the dict constructor a list of transient objects and a list of objects that can be used A class that checks a name of functions that never returns." }
[ { "content": "Please Give FORMAL Codereview for software developers in one sentence from the given diff hunk. Don’t start with Codereview/review. Just give the answer. Five examples are given before with code and code review and the code to work on is given after.", "role": "user" }, { "content": "Code: \t@@ -149,7 +149,8 @@ def simulate_raw(info, stc=None, trans=None, src=None, bem=None, head_pos=None,\n See Notes for details.\n \n .. versionchanged:: 0.18\n- Support for tuple, and iterable of tuple or SourceEstimate.\n+ Support for tuple, iterable of tuple or SourceEstimate,\n+ or SourceSimulator.\n trans : dict | str | None\n Either a transformation filename (usually made using mne_analyze)\n or an info dict (usually opened using read_trans()).\n\nCallgraph: \t[_add_exg->[_log_ch,_check_head_pos],simulate_raw->[_log_ch,_check_stc_iterable,_check_head_pos],add_chpi->[_log_ch,_check_head_pos]]\nCodereview: ", "role": "user" }, { "content": "the stc param type description should be changed accordingly. So far it just says: `stc : iterable | SourceEstimate` </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -413,6 +413,11 @@ AVAILABLE_CLI_OPTIONS = {\n metavar='INT',\n default=750,\n ),\n+ \"skip_trades\": Arg(\n+ '--skip-trades',\n+ help='Skip using trades file from backtesting and DB.',\n+ action='store_true',\n+ ),\n \"trade_source\": Arg(\n '--trade-source',\n help='Specify the source for trades (Can be DB or file (backtest file)) '\n\nCallgraph: \t[check_int_nonzero->[ArgumentTypeError,int],check_int_positive->[ArgumentTypeError,int],Arg]\nCodereview: ", "role": "user" }, { "content": "Personally, i would prefer to use `--no-trades`. While technically the trades loading is skipped, no-trades seems more intuitive to me - but it's a personal preference - so if you prefer skip-trades that's fine, too </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -921,6 +921,15 @@ def _plugins_parsing(helpful, plugins):\n \"plugins\", \"--configurator\", help=\"Name of the plugin that is \"\n \"both an authenticator and an installer. Should not be used \"\n \"together with --authenticator or --installer.\")\n+ helpful.add(\"plugins\", \"--apache\", action=\"store_true\",\n+ help=\"Obtain and install certs using Apache\")\n+ helpful.add(\"plugins\", \"--nginx\", action=\"store_true\",\n+ help=\"Obtain and install certs using Nginx\")\n+ helpful.add(\"plugins\", \"--standalone\", action=\"store_true\",\n+ help=('Obtain certs using a \"standalone\" webserver. '\n+ 'Changes the default \"run\" command to \"auth\".'))\n+\n+\n \n # things should not be reorder past/pre this comment:\n # plugins_group should be displayed in --help before plugin\n\nCallgraph: \t[_plugins_parsing->[add,add_group,add_plugin_args],_auth_from_domains->[_report_new_cert,_treat_as_renewal],revoke->[revoke,_determine_account],auth->[_auth_from_domains,_find_domains,_report_new_cert,choose_configurator_plugins,_init_le_client],_create_subparsers->[add_subparser,add,add_group,flag_default],setup_logging->[setup_log_file_handler],_treat_as_renewal->[_find_duplicative_certs],SilentParser->[add_argument->[add_argument]],HelpfulArgumentParser->[add_plugin_args->[add_group],add->[add_argument],__init__->[SilentParser,flag_default]],install->[_init_le_client,_find_domains,choose_configurator_plugins],run->[_init_le_client,_auth_from_domains,_find_domains,choose_configurator_plugins],create_parser->[HelpfulArgumentParser,flag_default,add,config_help,add_group],main->[setup_logging,create_parser],choose_configurator_plugins->[set_configurator,diagnose_configurator_problem],_paths_parser->[config_help,add,add_group,flag_default],_init_le_client->[_determine_account],rollback->[rollback],main]\nCodereview: ", "role": "user" }, { "content": "Help still needs to be updated. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -53,8 +53,8 @@ class KeyClient(AsyncKeyVaultClientBase):\n :param str name: The name of the new key.\n :param key_type: The type of key to create\n :type key_type: ~azure.keyvault.keys.KeyType or str\n- :keyword int size: RSA key size in bits, for example 2048, 3072, or 4096. Applies only to RSA keys. To\n- create an RSA key, consider using :func:`create_rsa_key` instead.\n+ :keyword int size: RSA key size in bits, for example 2048, 3072, or 4096. Applies only to RSA and octet sequence\n+ keys. Consider using :func:`create_rsa_key` or :func:`create_oct_key` instead.\n :keyword curve: Elliptic curve name. Applies only to elliptic curve keys. Defaults to the NIST P-256\n elliptic curve. To create an elliptic curve key, consider using :func:`create_ec_key` instead.\n :paramtype curve: ~azure.keyvault.keys.KeyCurveName or str\n\nCallgraph: \t[KeyClient->[get_key->[get_key],recover_deleted_key->[recover_deleted_key],create_ec_key->[create_key],delete_key->[delete_key],get_deleted_key->[get_deleted_key],purge_deleted_key->[purge_deleted_key],backup_key->[backup_key],create_rsa_key->[create_key],import_key->[import_key],create_key->[create_key]]]\nCodereview: ", "role": "user" }, { "content": "This is no longer *RSA* key size and if we list example sizes here, we must distinguish between symmetric and RSA key sizes. Also, I lean toward \"symmetric\" over \"octet sequence\" because it's more common. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -273,6 +273,11 @@ AVAILABLE_CLI_OPTIONS = {\n type=check_int_positive,\n metavar='INT',\n ),\n+ \"download_trades\": Arg(\n+ '--dl-trades',\n+ help='Download trades instead of OHLCV data.',\n+ action='store_true',\n+ ),\n \"exchange\": Arg(\n '--exchange',\n help=f'Exchange name (default: `{constants.DEFAULT_EXCHANGE}`). '\n\nCallgraph: \t[check_int_positive->[ArgumentTypeError,int],Arg,join]\nCodereview: ", "role": "user" }, { "content": "\"Download trades instead of OHLCV data. The bot will resample trades to the desired timeframe. (target timeframe, goal timeframe, timeframe specified)\" </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -273,6 +273,11 @@ class RefactoringChecker(checkers.BaseTokenChecker):\n \"consider using the list, dict or set constructor. \"\n \"It is faster and simpler.\",\n ),\n+ \"R1722\": (\n+ \"Consider using sys.exit()\",\n+ \"consider-using-sys-exit\",\n+ \"Instead of using exit() or quit(), consider using the sys.exit().\",\n+ ),\n }\n options = (\n (\nCallgraph: \t[RefactoringChecker->[_check_superfluous_else_raise->[_check_superfluous_else],process_tokens->[_is_trailing_comma],_check_nested_blocks->[_is_actual_elif],_check_chained_comparison->[_find_lower_upper_bounds],visit_with->[_check_redefined_argument_from_local],_check_consider_merging_isinstance->[_duplicated_isinstance_types],__init__->[__init__],visit_if->[_check_superfluous_else_raise,_check_superfluous_else_return,_check_simplifiable_if,_check_consider_get],_check_swap_variables->[_is_simple_assignment],visit_assign->[_check_swap_variables],_check_superfluous_else->[_is_actual_elif,_if_statement_is_always_returning],visit_excepthandler->[_check_redefined_argument_from_local],leave_module->[_init],visit_augassign->[_check_consider_using_join],visit_for->[_check_redefined_argument_from_local],_is_node_return_ended->[_is_node_return_ended],visit_boolop->[_check_chained_comparison,_check_consider_using_in,_check_consider_merging_isinstance],visit_call->[_check_consider_using_comprehension_constructor],_check_simplifiable_if->[_is_actual_elif,_is_bool_const],_check_superfluous_else_return->[_check_superfluous_else],_check_raising_stopiteration_in_generator_next_call->[_looks_like_infinite_iterator],_check_consider_get->[type_and_name_are_equal]],RecommandationChecker->[visit_for->[_is_constant_zero,_is_builtin]],_is_trailing_comma->[get_curline_index_start],LenChecker->[visit_call->[_is_len_call,_node_is_test_condition],visit_unaryop->[_is_len_call]],register->[RefactoringChecker,RecommandationChecker,NotChecker,LenChecker]]\nCodereview: ", "role": "user" } ]
9ef6bf7111827712
{ "callgraph": "[cleanExpiredHosts->[val,asyncMultiPut,begin,emplace_back,valid,find,size,CHECK_EQ,LOG,end,erase,empty,key,prefix,next],getActiveHosts->[begin,end,size,resize],loadHostMap->[val,valid,LOG,updateHostInfo,key,prefix,next],intervalSeconds_->[CHECK_GT,CHECK_GE,addTimerTask,CHECK,start],updateHostInfo->[wait,asyncMultiPut,emplace_back,find,isLeader,emplace,end,empty,post]]", "msg": "what to do if some failed? just logging?", "patch": "@@ -146,7 +146,9 @@ void ActiveHostsMan::cleanExpiredHosts() {\n LOG(INFO) << \"set \" << data.size() << \" expired hosts to offline in meta rocksdb\";\n kvstore_->asyncMultiPut(kDefaultSpaceId, kDefaultPartId, std::move(data),\n [] (kvstore::ResultCode code) {\n- CHECK_EQ(code, kvstore::ResultCode::SUCCEEDED);\n+ if (code != kvstore::ResultCode::SUCCEEDED) {\n+ LOG(WARNING) << \"put failed, ret \" << static_cast<int32_t>(code);\n+ }\n });\n }\n }", "summary": "Clean expired hosts. expired hosts to offline in meta rocksdb." }
[ { "content": "Please Give FORMAL Codereview for software developers in one sentence from the given diff hunk. Don’t start with Codereview/review. Just give the answer. Five examples are given before with code and code review and the code to work on is given after.", "role": "user" }, { "content": "Code: \t@@ -906,8 +906,8 @@ void attachEvents() {\n for (const auto& subscriber : subscribers) {\n auto status = EventFactory::registerEventSubscriber(subscriber.second);\n if (!status.ok()) {\n- LOG(INFO) << \"Error registering subscriber: \" << subscriber.first << \": \"\n- << status.getMessage();\n+ VLOG(1) << \"Error registering subscriber: \" << subscriber.first << \": \"\n+ << status.getMessage();\n }\n }\n \n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "Any particular reason this should stay as an info level log versus something like `LOG(WARNING)`? I think I like the change to `VLOG(1)` also, but it seems to me more consistent with the flow of events if this was a `LOG(WARNING)` as above. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -131,10 +131,9 @@ Status readFile(const fs::path& path,\n auto read_max = static_cast<off_t>(FLAGS_read_max);\n if (file_size > read_max) {\n if (!dry_run) {\n- LOG(WARNING) << \"Cannot read file that exceeds size limit: \"\n- << path.string();\n- VLOG(1) << \"Cannot read \" << path.string()\n- << \" size exceeds limit: \" << file_size << \" > \" << read_max;\n+ return Status::failure(\n+ \"Cannot read \" + path.string() + \" size exceeds limit: \" +\n+ std::to_string(file_size) + \" > \" + std::to_string(read_max));\n }\n return Status::failure(\"File exceeds read limits\");\n }\n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "The issue here though is that it's not guaranteed that all the readFile callers will log this error, so we should ensure that they are, to not change the end result. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -62,7 +62,17 @@ void launchQueries(const std::vector<OsqueryScheduledQuery>& queries,\n const int64_t& second) {\n for (const auto& q : queries) {\n if (second % q.interval == 0) {\n- LOG(INFO) << \"Executing query: \" << q.query;\n+ std::string hostIdentifier;\n+ try {\n+ hostIdentifier = getHostIdentifier(FLAGS_host_identifier, DBHandle::getInstance());\n+ }\n+ catch(std::exception& e){\n+ LOG(ERROR) << \"Unable to access hostIdentifier in database: \" << e.what() << \"; Using hostname to \"\n+ \"identify this machine\";\n+ hostIdentifier = osquery::getHostname();\n+ }\n+\n+ LOG(INFO) << hostIdentifier << \" is executing query: \" << q.query;\n int unix_time = std::time(0);\n auto sql = SQL(q.query);\n if (!sql.ok()) {\n\nCallgraph: \t[initializeScheduler->[launchQueries],launchQueries->[getHostIdentifier]]\nCodereview: ", "role": "user" }, { "content": "nit, but can you make this `const std::exception& e`? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -623,9 +623,6 @@ Status upgradeDatabase(int to_version) {\n return Status(1, \"Database migration failed.\");\n }\n \n- LOG(INFO) << \"Migration \" << db_version << \" -> \" << (db_version + 1)\n- << \" successfully completed!\";\n-\n db_version++;\n }\n \n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "this status is wrong... should be something like 'DB migration ok, failed to set new version' </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -239,6 +239,13 @@ void SchedulerRunner::start() {\n break;\n }\n }\n+\n+ // Scheduler ended.\n+ if (!interrupted()) {\n+ LOG(INFO) << \"The scheduler ended after \" << FLAGS_schedule_timeout\n+ << \" seconds\";\n+ requestShutdown();\n+ }\n }\n \n std::chrono::milliseconds SchedulerRunner::getCurrentTimeDrift() const\n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "Why use `FLAGS_schedule_timeout` here? Wouldn't it be better to write out `_timeout` so we know how long it actually ran for, as opposed to the desired timeout? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -146,7 +146,9 @@ void ActiveHostsMan::cleanExpiredHosts() {\n LOG(INFO) << \"set \" << data.size() << \" expired hosts to offline in meta rocksdb\";\n kvstore_->asyncMultiPut(kDefaultSpaceId, kDefaultPartId, std::move(data),\n [] (kvstore::ResultCode code) {\n- CHECK_EQ(code, kvstore::ResultCode::SUCCEEDED);\n+ if (code != kvstore::ResultCode::SUCCEEDED) {\n+ LOG(WARNING) << \"put failed, ret \" << static_cast<int32_t>(code);\n+ }\n });\n }\n }\nCallgraph: \t[cleanExpiredHosts->[val,asyncMultiPut,begin,emplace_back,valid,find,size,CHECK_EQ,LOG,end,erase,empty,key,prefix,next],getActiveHosts->[begin,end,size,resize],loadHostMap->[val,valid,LOG,updateHostInfo,key,prefix,next],intervalSeconds_->[CHECK_GT,CHECK_GE,addTimerTask,CHECK,start],updateHostInfo->[wait,asyncMultiPut,emplace_back,find,isLeader,emplace,end,empty,post]]\nCodereview: ", "role": "user" } ]
227dc48253ec11e5
{ "callgraph": "[Error->[Error],Shutdown->[Wait,add,recoveryHandleCleanup,Close,hasErrors,Errorf,Shutdown,Go,p2pCancel],NewTracer,Start,Sleep,SetAddPeersHandler,Init,Int64,WithConnectionConfigs,Join,NewFixedPricer,SetPaymentThresholdObserver,EthereumAddress,WriterLevel,Background,NewChequeStore,NewStateStore,HexToAddress,NewCashoutService,Debugf,Bytes,SetSwap,SetPushSyncer,Warningf,Addresses,AddProtocol,Register,NewMultiResolver,NewFactory,IsHexAddress,SetNotifyPaymentFunc,Protocol,WithLogger,Metrics,NewRepairHandler,MustRegisterMetrics,After,Ready,Dial,NATManager,Serve,NewService,Debug,New,SetNotifier,DiscoverFactoryAddress,NewAccounting,NewChequeSigner,NewAddressbook,NewTags,Info,Warning,Infof,WithCancel,NewMultiaddr,NewCallback,Addr,Error,ChainID,Errorf,Listen]", "msg": "It provides a type called Node which is a fully functional bee client. This package is where the dependencies are injected. It is not just a glue-code, it is concept of node.", "patch": "@@ -2,6 +2,8 @@\n // Use of this source code is governed by a BSD-style\n // license that can be found in the LICENSE file.\n \n+// Package node provides the glue-code needed in order\n+// to start a Bee node.\n package node\n \n import (", "summary": "License for the BSD - style license of the source code. Package hierarchy for all packages." }
[ { "content": "Please Give FORMAL Codereview for software developers in one sentence from the given diff hunk. Don’t start with Codereview/review. Just give the answer. Five examples are given before with code and code review and the code to work on is given after.", "role": "user" }, { "content": "Code: \t@@ -2,6 +2,10 @@\n // Use of this source code is governed by a MIT-style\n // license that can be found in the LICENSE file.\n \n+// Copyright 2018 The Gitea Authors. All rights reserved.\n+// Use of this source code is governed by a MIT-style\n+// license that can be found in the LICENSE file.\n+\n package repo\n \n import (\n\nCallgraph: \t[Status,GetIssueByIndex,IsPoster,IsWriter,UpdateIssue,Error,IsErrIssueNotExist,ChangeStatus,UpdateIssueUserByAssignee,ChangeMilestoneAssign,JSON,ParamsInt64,StateType,ToLower,IsErrUserNotExist,GetUserByName,Query,APIFormat,Sprintf,SetLinkHeader,NewIssue,GetIssueByID,QueryInt,Issues]\nCodereview: ", "role": "user" }, { "content": "This is not required </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -1,10 +1,12 @@\n // Copyright 2014 The Gogs Authors. All rights reserved.\n+// Copyright 2019 The Gogs Authors. All rights reserved.\n // Use of this source code is governed by a MIT-style\n // license that can be found in the LICENSE file.\n \n package context\n \n import (\n+\t\"code.gitea.io/gitea/models\"\n \t\"code.gitea.io/gitea/modules/auth\"\n \t\"code.gitea.io/gitea/modules/log\"\n \t\"code.gitea.io/gitea/modules/setting\"\n\nCallgraph: \t[Tr,Redirect,HTML,IsAPIPath,Written,Error,RemoteAddr,Validate,SetCookie,GetCookie,JSON,Info]\nCodereview: ", "role": "user" }, { "content": "Gitea, not Gogs. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -1,4 +1,5 @@\n // Copyright 2016 The Gogs Authors. All rights reserved.\n+// Copyright 2016 The Gitea Authors. All rights reserved.\n // Use of this source code is governed by a MIT-style\n // license that can be found in the LICENSE file.\n \n\nCallgraph: \t[Printf,SetEngine,Bool,CreateUser,String,Errorf,LoadConfigs,IsSet,NewContext]\nCodereview: ", "role": "user" }, { "content": "Please send this line top on the Gogs </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -1,10 +1,15 @@\n // Copyright 2015 The Gogs Authors. All rights reserved.\n+// Copyright 2019 The Gitea Authors. All rights reserved.\n // Use of this source code is governed by a MIT-style\n // license that can be found in the LICENSE file.\n \n package models\n \n-import \"fmt\"\n+import (\n+\t\"fmt\"\n+\n+\t\"code.gitea.io/gitea/modules/git\"\n+)\n \n // ErrNameReserved represents a \"reserved name\" error.\n type ErrNameReserved struct {\n\nCallgraph: \t[Error->[Sprintf,Error]]\nCodereview: ", "role": "user" }, { "content": "This isn't your fault - but this file is insanely long now. It needs splitting - but that can be done in different PR. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -1,4 +1,4 @@\n-// Copyright 2014 The Gogs Authors. All rights reserved.\n+// Copyright 2017 Gitea. All rights reserved.\n // Use of this source code is governed by a MIT-style\n // license that can be found in the LICENSE file.\n \n\nCallgraph: \t[EventsArray->[HasPushEvent,HasCreateEvent,HasPullRequestEvent],deliver,HasPushEvent,HasCreateEvent,HasPullRequestEvent]\nCodereview: ", "role": "user" }, { "content": "Hm, you can add a line. But the copyright to the old stuff cannot be removed, FMPOV. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -2,6 +2,8 @@\n // Use of this source code is governed by a BSD-style\n // license that can be found in the LICENSE file.\n \n+// Package node provides the glue-code needed in order\n+// to start a Bee node.\n package node\n \n import (\nCallgraph: \t[Error->[Error],Shutdown->[Wait,add,recoveryHandleCleanup,Close,hasErrors,Errorf,Shutdown,Go,p2pCancel],NewTracer,Start,Sleep,SetAddPeersHandler,Init,Int64,WithConnectionConfigs,Join,NewFixedPricer,SetPaymentThresholdObserver,EthereumAddress,WriterLevel,Background,NewChequeStore,NewStateStore,HexToAddress,NewCashoutService,Debugf,Bytes,SetSwap,SetPushSyncer,Warningf,Addresses,AddProtocol,Register,NewMultiResolver,NewFactory,IsHexAddress,SetNotifyPaymentFunc,Protocol,WithLogger,Metrics,NewRepairHandler,MustRegisterMetrics,After,Ready,Dial,NATManager,Serve,NewService,Debug,New,SetNotifier,DiscoverFactoryAddress,NewAccounting,NewChequeSigner,NewAddressbook,NewTags,Info,Warning,Infof,WithCancel,NewMultiaddr,NewCallback,Addr,Error,ChainID,Errorf,Listen]\nCodereview: ", "role": "user" } ]
24d018dc07d55e7c
{ "callgraph": "[EthGetCode->[getName->[getMethodName],blockParameterOrBlockHash->[getRequiredParameter],resultByBlockHash->[toHexString,isPresent,getPrivateWorldStateAtBlock,getRequiredParameter,orElse,get,getBlockHeaderByHash,getGoQuorumPrivacyParameters]]]", "msg": "Same here, can we presume if `privacyParameters` is set we need goQuorum handling? Or is there a goQuorum sub option in `privacyParametes`?", "patch": "@@ -64,7 +64,8 @@ public class EthGetCode extends AbstractBlockParameterOrBlockHashMethod {\n @Override\n protected String resultByBlockHash(final JsonRpcRequestContext request, final Hash blockHash) {\n final Address address = request.getRequiredParameter(0, Address.class);\n- if (GoQuorumOptions.goQuorumCompatibilityMode && privacyParameters.isPresent()) {\n+ final boolean isGoQuorumCompatibilityMode = GoQuorumOptions.goQuorumCompatibilityMode;\n+ if (isGoQuorumCompatibilityMode && privacyParameters.isPresent()) {\n // get from private state if we can\n final Optional<BlockHeader> blockHeader =\n blockchainQueries.get().getBlockHeaderByHash(blockHash);", "summary": "Get the code associated with a block." }
[ { "content": "Please Give FORMAL Codereview for software developers in one sentence from the given diff hunk. Don’t start with Codereview/review. Just give the answer. Five examples are given before with code and code review and the code to work on is given after.", "role": "user" }, { "content": "Code: \t@@ -42,14 +42,14 @@ import org.infinispan.remoting.transport.Address;\n * @author wburns\n * @since 9.3\n */\n-@Listener\n public class DefaultSegmentedDataContainer<K, V> extends AbstractInternalDataContainer<K, V> {\n \n private static final Log log = LogFactory.getLog(MethodHandles.lookup().lookupClass());\n private static final boolean trace = log.isTraceEnabled();\n \n- public final AtomicReferenceArray<ConcurrentMap<K, InternalCacheEntry<K, V>>> maps;\n- protected Address localNode;\n+ protected final AtomicReferenceArray<ConcurrentMap<K, InternalCacheEntry<K, V>>> maps;\n+ protected boolean shouldStopSegments;\n+\n \n public DefaultSegmentedDataContainer(int numSegments) {\n maps = new AtomicReferenceArray<>(numSegments);\n\nCallgraph: \t[DefaultSegmentedDataContainer->[removeSegments->[forEach],forEachIncludingExpired->[forEach],forEach->[forEach],keySet->[size->[size],spliterator->[spliterator],iterator->[iteratorIncludingExpired]],sizeIncludingExpired->[iterator],clear->[clear],addSegments->[forEach]]]\nCodereview: ", "role": "user" }, { "content": "What are we removing this? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -226,10 +226,8 @@ public class DiceServerEditor extends JPanel {\n public boolean areFieldsValid() {\n final boolean toValid =\n !toAddress.getText().isEmpty() && PlayerEmailValidation.isValid(toAddress.getText());\n- SwingComponents.highlightLabelIfNotValid(toValid, toLabel);\n final boolean ccValid =\n !ccAddress.getText().isEmpty() && PlayerEmailValidation.isValid(ccAddress.getText());\n- SwingComponents.highlightLabelIfNotValid(ccValid, ccLabel);\n \n final boolean allValid = toValid && ccValid;\n testDiceButton.setEnabled(allValid);\n\nCallgraph: \t[DiceServerEditor->[areFieldsValid->[isValid,setToolTipText,isEmpty,getText,setEnabled,highlightLabelIfNotValid],applyToGameProperties->[getText,set],newDiceServer->[build],checkFieldsAndNotify->[areFieldsValid,run],populateFromGameProperties->[setText,get],GridBagConstraints,create,equals,newDiceServer,toString,test,setLayout,GridBagLayout,PbemDiceRoller,JTextField,JButton,addActionListener,orElseThrow,TitledBorder,build,JPanel,setBorder,attachDocumentListener,JLabel,add,Insets]]\nCodereview: ", "role": "user" }, { "content": "In theory the enabled button stuff should be performed on the event queue as well, but swing doesn't really care. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -71,7 +71,14 @@ public final class OAuth20ProfileController extends AbstractController {\n protected ModelAndView handleRequestInternal(final HttpServletRequest request, final HttpServletResponse response)\n throws Exception {\n \n- final String accessToken = request.getParameter(OAuthConstants.ACCESS_TOKEN);\n+ String accessToken = request.getParameter(OAuthConstants.ACCESS_TOKEN);\n+ if (StringUtils.isBlank(accessToken)) {\n+ // try getting the bearer token from the authorization header\n+ final String authHeader = request.getHeader(\"Authorization\");\n+ if (authHeader != null && authHeader.startsWith(\"bearer \")) {\n+ accessToken = authHeader.substring(7);\n+ }\n+ }\n LOGGER.debug(\"{} : {}\", OAuthConstants.ACCESS_TOKEN, accessToken);\n \n final JsonGenerator jsonGenerator = this.jsonFactory.createJsonGenerator(response.getWriter());\n\nCallgraph: \t[OAuth20ProfileController->[handleRequestInternal->[isExpired,writeEndObject,getPrincipal,writeArrayFieldStart,isBlank,writeStringField,setContentType,writeObjectField,createJsonGenerator,debug,error,getWriter,writeEndArray,flushBuffer,getTicket,get,closeQuietly,writeStartObject,getParameter,getId,getAttributes,keySet],JsonFactory,getLogger,ObjectMapper]]\nCodereview: ", "role": "user" }, { "content": "This should also be StringUtils.isNotBlank </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -71,7 +71,13 @@ public final class OAuth20ProfileController extends AbstractController {\n protected ModelAndView handleRequestInternal(final HttpServletRequest request, final HttpServletResponse response)\n throws Exception {\n \n- final String accessToken = request.getParameter(OAuthConstants.ACCESS_TOKEN);\n+ String accessToken = request.getParameter(OAuthConstants.ACCESS_TOKEN);\n+ if (StringUtils.isBlank(accessToken)) {\n+ final String authHeader = request.getHeader(\"Authorization\");\n+ if (StringUtils.isNotBlank(accessToken) && authHeader.startsWith(\"bearer \")) {\n+ accessToken = authHeader.substring(7);\n+ }\n+ }\n LOGGER.debug(\"{} : {}\", OAuthConstants.ACCESS_TOKEN, accessToken);\n \n final JsonGenerator jsonGenerator = this.jsonFactory.createJsonGenerator(response.getWriter());\n\nCallgraph: \t[OAuth20ProfileController->[handleRequestInternal->[isExpired,writeEndObject,getPrincipal,writeArrayFieldStart,isBlank,writeStringField,setContentType,writeObjectField,createJsonGenerator,debug,error,getWriter,writeEndArray,flushBuffer,getTicket,get,closeQuietly,writeStartObject,getParameter,getId,getAttributes,keySet],JsonFactory,getLogger,ObjectMapper]]\nCodereview: ", "role": "user" }, { "content": "This String probably should be moved over to `OAuthConstants`? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -161,9 +161,9 @@ public class AsyncQueryForwardingServlet extends AsyncProxyServlet\n final String defaultHost = hostFinder.getDefaultHost();\n request.setAttribute(HOST_ATTRIBUTE, defaultHost);\n \n- final boolean isQueryEndpoint = request.getRequestURI().startsWith(\"/druid/v2\");\n+ final String requestURI = request.getRequestURI();\n \n- if (isQueryEndpoint && HttpMethod.DELETE.is(request.getMethod())) {\n+ if (requestURI.startsWith(QUERY_URL_V2) && HttpMethod.DELETE.is(request.getMethod())) {\n // query cancellation request\n for (final String host : hostFinder.getAllHosts()) {\n // send query cancellation to all brokers this query may have gone to\n\nCallgraph: \t[AsyncQueryForwardingServlet->[destroy->[destroy],service->[handleException,service],init->[init],rewriteURI->[rewriteURI],MetricsEmittingProxyResponseListener->[onComplete->[onComplete],onFailure->[onFailure]],createHttpClient->[createHttpClient],newProxyResponseListener->[newProxyResponseListener]]]\nCodereview: ", "role": "user" }, { "content": "This kind of logic strikes me as something that should be able to be handled at a more abstract routing level. Have you had a chance to look for such items? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -64,7 +64,8 @@ public class EthGetCode extends AbstractBlockParameterOrBlockHashMethod {\n @Override\n protected String resultByBlockHash(final JsonRpcRequestContext request, final Hash blockHash) {\n final Address address = request.getRequiredParameter(0, Address.class);\n- if (GoQuorumOptions.goQuorumCompatibilityMode && privacyParameters.isPresent()) {\n+ final boolean isGoQuorumCompatibilityMode = GoQuorumOptions.goQuorumCompatibilityMode;\n+ if (isGoQuorumCompatibilityMode && privacyParameters.isPresent()) {\n // get from private state if we can\n final Optional<BlockHeader> blockHeader =\n blockchainQueries.get().getBlockHeaderByHash(blockHash);\nCallgraph: \t[EthGetCode->[getName->[getMethodName],blockParameterOrBlockHash->[getRequiredParameter],resultByBlockHash->[toHexString,isPresent,getPrivateWorldStateAtBlock,getRequiredParameter,orElse,get,getBlockHeaderByHash,getGoQuorumPrivacyParameters]]]\nCodereview: ", "role": "user" } ]
bdc84bf1acc175a6
{ "callgraph": "[MethodNameDeclaration->[getParameterDisplaySignature->[getParameterCount,isVarargs],isVarargs->[isVarargs],toString->[getParameterCount],equals->[getParameterCount,isVarargs,equals],hashCode->[getParameterCount,hashCode],getParameterCount->[getParameterCount]]]", "msg": "In case the method is `void`, there won't be any children and `getChild(0)` throws. We'll need to check with `isVoid()` for that case. I'll update this when I merge.", "patch": "@@ -32,6 +32,11 @@ public class MethodNameDeclaration extends AbstractNameDeclaration {\n return p.isVarargs();\n }\n \n+ public boolean isPrimitiveReturnType() {\n+ return getMethodNameDeclaratorNode().getParent().getResultType().getChild(0)\n+ .getChild(0) instanceof ASTPrimitiveType;\n+ }\n+\n public ASTMethodDeclarator getMethodNameDeclaratorNode() {\n return (ASTMethodDeclarator) node;\n }", "summary": "This method returns true if the node is a varargs or a formal parameter." }
[ { "content": "Please Give FORMAL Codereview for software developers in one sentence from the given diff hunk. Don’t start with Codereview/review. Just give the answer. Five examples are given before with code and code review and the code to work on is given after.", "role": "user" }, { "content": "Code: \t@@ -32,6 +32,11 @@ public class DubboInstrumentationModule extends InstrumentationModule {\n return hasClassesNamed(\"org.apache.dubbo.rpc.Filter\");\n }\n \n+ @Override\n+ public boolean isLibraryInstrumentationClass(String className) {\n+ return className.startsWith(\"io.opentelemetry.instrumentation.apachedubbo.v2_7\");\n+ }\n+\n @Override\n public List<TypeInstrumentation> typeInstrumentations() {\n return Collections.singletonList(new DubboInstrumentation());\n\nCallgraph: \t[DubboInstrumentationModule->[typeInstrumentations->[singletonList,DubboInstrumentation],classLoaderMatcher->[hasClassesNamed]]]\nCodereview: ", "role": "user" }, { "content": "Can this be replaced with `this.getClass().getPackage().getName()` and moved to superclass? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -2530,6 +2530,17 @@ public class DoFnSignatures {\n return signatureForDoFn(doFn).usesState() || requiresTimeSortedInput(doFn);\n }\n \n+ private static boolean containsBundleFinalizer(List<Parameter> parameters) {\n+ return parameters.stream().anyMatch(parameter -> parameter instanceof BundleFinalizerParameter);\n+ }\n+\n+ public static boolean usesBundleFinalizer(DoFn<?, ?> doFn) {\n+ DoFnSignature sig = signatureForDoFn(doFn);\n+ return containsBundleFinalizer(sig.startBundle().extraParameters())\n+ || containsBundleFinalizer(sig.finishBundle().extraParameters())\n+ || containsBundleFinalizer(sig.processElement().extraParameters());\n+ }\n+\n public static boolean requiresTimeSortedInput(DoFn<?, ?> doFn) {\n return signatureForDoFn(doFn).processElement().requiresTimeSortedInput();\n }\n\nCallgraph: \t[DoFnSignatures->[getStateSpecOrThrow->[format],analyzeTimerFamilyDeclarations->[create],analyzeProcessElementMethod->[of,getExtraParameters,addParameter,create,setParameter],analyzeStateDeclarations->[of,create,getType],analyzeExtraParameter->[of,getAnnotations,doFnStartBundleContextTypeOf,hasParameter,doFnProcessContextTypeOf,getType,getMethod,doFnOnTimerContextTypeOf,getIndex,doFnFinishBundleContextTypeOf,doFnOnWindowExpirationContextTypeOf,getDeclaringClass],validateTimerField->[getType],ErrorReporter->[forParameter->[ErrorReporter,getIndex,format,getType],forMethod->[ErrorReporter,format],throwIllegalArgument->[format],checkArgument->[throwIllegalArgument],checkNotNull->[throwIllegalArgument],format],MethodAnalysisContext->[create->[MethodAnalysisContext]],parseSignature->[of,getTimerDeclarations,addTimerFamilyDeclarations,getTimerFamilyDeclarations,addStateDeclarations,addFieldAccessDeclarations,create,getStateDeclarations,getFieldAccessDeclarations,addTimerDeclarations],analyzeOnTimerFamilyMethod->[of,create],verifySplittableMethods->[of],analyzeOnWindowExpirationMethod->[of,create],getTimerSpecOrThrow->[format],FnAnalysisContext->[addTimerFamilyDeclarations->[addTimerFamilyDeclaration],addStateDeclarations->[addStateDeclaration],addFieldAccessDeclarations->[addFieldAccessDeclaration],create->[FnAnalysisContext],addTimerDeclarations->[addTimerDeclaration]],analyzeSplitRestrictionMethod->[of,addParameter,getExtraParameters,create,getWindowType,analyzeExtraParameter,checkParameterOneOf],getDeclaringClass->[getDeclaringClass],analyzeOnTimerMethod->[of,create],analyzeGetInitialWatermarkEstimatorStateMethod->[of,addParameter,getExtraParameters,create,getWindowType,analyzeExtraParameter,checkParameterOneOf],analyzeNewWatermarkEstimatorMethod->[of,addParameter,getExtraParameters,create,watermarkEstimatorTypeOf,analyzeExtraParameter,getWindowType,checkParameterOneOf],analyzeGetSizeMethod->[of,addParameter,getExtraParameters,create,getWindowType,analyzeExtraParameter,checkParameterOneOf],format->[getType],analyzeStartBundleMethod->[of,getExtraParameters,addParameter,create,analyzeExtraParameter,checkParameterOneOf],analyzeGetInitialRestrictionMethod->[of,addParameter,getExtraParameters,create,getWindowType,analyzeExtraParameter,checkParameterOneOf],validateTimerFamilyField->[getType],analyzeFieldAccessDeclaration->[create,getType],analyzeNewTrackerMethod->[of,addParameter,getExtraParameters,create,restrictionTrackerTypeOf,getWindowType,analyzeExtraParameter,checkParameterOneOf],analyzeTruncateRestrictionMethod->[of,addParameter,getExtraParameters,create,getWindowType,analyzeExtraParameter,checkParameterOneOf],usesTimers->[usesTimers],analyzeSetupMethod->[of,getExtraParameters,addParameter,create,analyzeExtraParameter,checkParameterOneOf],analyzeTimerDeclarations->[create],analyzeFinishBundleMethod->[of,getExtraParameters,addParameter,create,analyzeExtraParameter,checkParameterOneOf],usesState->[usesState],analyzeGetWatermarkEstimatorStateCoderMethod->[of,create],analyzeShutdownMethod->[create],requiresTimeSortedInput->[requiresTimeSortedInput],analyzeGetRestrictionCoderMethod->[of,create],usesGivenStateClass->[of],isSplittable->[isSplittable],getTimerFamilySpecOrThrow->[format]]]\nCodereview: ", "role": "user" }, { "content": "Technically, the design of the class is to use `parameter.match(new Cases() { ... })` but I'll accept this. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -31,6 +31,10 @@ public class ActorRestartTest extends BaseTest {\n return value;\n }\n \n+ public boolean askRayWasCurrentActorRestarted() {\n+ return Ray.getRuntimeContext().wasCurrentActorRestarted();\n+ }\n+\n public int getPid() {\n return SystemUtil.pid();\n }\n\nCallgraph: \t[ActorRestartTest->[Counter->[getPid->[pid],wasCurrentActorRestarted],testActorRestart->[assertTrue,fail,sleep,get,remote,exec,assertFalse,assertEquals]]]\nCodereview: ", "role": "user" }, { "content": "what about `checkWasCurrentActorRestartedInActorTask`? and `wasCurrentActorRestarted` can be renamed to `checkWasCurrentActorRestartedInActorCreationTask` </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -34,6 +34,16 @@ public class FindInFilesEvent extends GwtEvent<FindInFilesEvent.Handler>\n return searchPattern_;\n }\n \n+ public boolean getReplace()\n+ {\n+ return replace_;\n+ }\n+\n+ public String getReplacePattern()\n+ {\n+ return replacePattern_;\n+ }\n+\n @Override\n public Type<Handler> getAssociatedType()\n {\n\nCallgraph: \t[FindInFilesEvent->[dispatch->[onFindInFiles]]]\nCodereview: ", "role": "user" }, { "content": "Nit: Could you rename this to something that sounds like a boolean phrase like `isReplace` or `replaceEnabeled`? Right now the name feels to me like it should return a replace string </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -264,4 +264,18 @@ public abstract class ServerNotification extends EventObject implements MuleCont\n return resource;\n }\n \n+ public static boolean resolveEventReference(MuleEvent event)\n+ {\n+ if (event instanceof VoidMuleEvent)\n+ {\n+ return true;\n+ }\n+ \n+ if (event instanceof DefaultMuleEvent)\n+ {\n+ return ((DefaultMuleEvent) event).resolveEventSynchronicity();\n+ }\n+ \n+ return event.isSynchronous();\n+ }\n }\n\nCallgraph: \t[ServerNotification->[copyResource->[cloneMessage],getActionName->[getActionName],toString->[getServerId],getServerId->[generateId],getPayloadToString->[toString]]]\nCodereview: ", "role": "user" }, { "content": "only have this check and return true otherwise </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -32,6 +32,11 @@ public class MethodNameDeclaration extends AbstractNameDeclaration {\n return p.isVarargs();\n }\n \n+ public boolean isPrimitiveReturnType() {\n+ return getMethodNameDeclaratorNode().getParent().getResultType().getChild(0)\n+ .getChild(0) instanceof ASTPrimitiveType;\n+ }\n+\n public ASTMethodDeclarator getMethodNameDeclaratorNode() {\n return (ASTMethodDeclarator) node;\n }\nCallgraph: \t[MethodNameDeclaration->[getParameterDisplaySignature->[getParameterCount,isVarargs],isVarargs->[isVarargs],toString->[getParameterCount],equals->[getParameterCount,isVarargs,equals],hashCode->[getParameterCount,hashCode],getParameterCount->[getParameterCount]]]\nCodereview: ", "role": "user" } ]
428337f896113abb
{ "callgraph": "[RefactoringChecker->[leave_module->[_init],_check_consider_merging_isinstance->[_duplicated_isinstance_types],__init__->[__init__],visit_augassign->[_check_consider_using_join],visit_if->[_check_superfluous_else_return,_check_simplifiable_if,_check_consider_get],_check_swap_variables->[_is_simple_assignment],visit_for->[_check_redefined_argument_from_local],_check_nested_blocks->[_is_actual_elif],_is_node_return_ended->[_is_node_return_ended],_check_consider_get->[type_and_name_are_equal],_check_superfluous_else_return->[_is_actual_elif,_if_statement_is_always_returning],visit_assign->[_check_swap_variables],_check_raising_stopiteration_in_generator_next_call->[_looks_like_infinite_iterator],visit_boolop->[_check_consider_using_in,_check_consider_merging_isinstance],visit_with->[_check_redefined_argument_from_local],_check_simplifiable_if->[_is_actual_elif,_is_bool_const],visit_excepthandler->[_check_redefined_argument_from_local]],_if_statement_is_always_returning->[_has_return_node->[_if_statement_is_always_returning],_has_return_node,_all_elements_are_true],RecommandationChecker->[visit_for->[_is_builtin]],is_trailing_comma->[get_curline_index_start],LenChecker->[visit_compare->[_is_len_call,_is_constant_zero,_has_constant_value,_node_is_test_condition],visit_call->[_is_len_call,_node_is_test_condition],visit_unaryop->[_is_len_call]],register->[RefactoringChecker,RecommandationChecker,NotChecker,LenChecker]]", "msg": "I'd rephrase it as `Simplify chained comparison between the operands`.", "patch": "@@ -155,6 +155,10 @@ class RefactoringChecker(checkers.BaseTokenChecker):\n 'if a key is present or a default if not, is simpler and considered '\n 'more idiomatic, although sometimes a bit slower'\n ),\n+ 'R1716': ('simplify chained comparison',\n+ 'chained-comparison',\n+ 'Chained comparisons like \"a < b and b < c\" can be simplified as \"a < b < c\"',\n+ ),\n }\n options = (('max-nested-blocks',\n {'default': 5, 'type': 'int', 'metavar': '<int>',", "summary": "Requirements for the n - nested - block function. Constructor for a TokenChecker class." }
[ { "content": "Please Give FORMAL Codereview for software developers in one sentence from the given diff hunk. Don’t start with Codereview/review. Just give the answer. Five examples are given before with code and code review and the code to work on is given after.", "role": "user" }, { "content": "Code: \t@@ -81,10 +81,11 @@ class RequirementSet(object):\n wheel.filename\n )\n \n- install_req.use_user_site = self.use_user_site\n- install_req.target_dir = self.target_dir\n- install_req.pycompile = self.pycompile\n- install_req.is_direct = (parent_req_name is None)\n+ # This next bit is really a sanity check.\n+ assert install_req.is_direct == (parent_req_name is None), (\n+ \"a direct req shouldn't have a parent and also, \"\n+ \"a non direct req should have a parent\"\n+ )\n \n if not name:\n # url or path requirement w/o an egg fragment\n\nCallgraph: \t[RequirementSet->[_to_install->[schedule->[schedule],schedule],install->[_to_install,install]]]\nCodereview: ", "role": "user" }, { "content": "@pfmoore the intention is to have requirementset.add do less. By moving this outside, I've tried to make it explicit which paths go which way. This makes it easier to keep track of what's happening (because this bit of code is highly intertwined). I'm sort of trying to untangle this bit of code here. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -81,10 +81,11 @@ class RequirementSet(object):\n wheel.filename\n )\n \n- install_req.use_user_site = self.use_user_site\n- install_req.target_dir = self.target_dir\n- install_req.pycompile = self.pycompile\n- install_req.is_direct = (parent_req_name is None)\n+ # This next bit is really a sanity check.\n+ assert install_req.is_direct == (parent_req_name is None), (\n+ \"a direct req shouldn't have a parent and also, \"\n+ \"a non direct req should have a parent\"\n+ )\n \n if not name:\n # url or path requirement w/o an egg fragment\n\nCallgraph: \t[RequirementSet->[_to_install->[schedule->[schedule],schedule],install->[_to_install,install]]]\nCodereview: ", "role": "user" }, { "content": "@pfmoore the intention is to have requirementset.add do less. By moving this outside, I've tried to make it explicit which paths go which way. This makes it easier to keep track of what's happening (because this bit of code is highly intertwined). I'm sort of trying to untangle this bit of code here. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -97,9 +97,9 @@ def test_state_operators():\n \n \n def test_event_operators():\n- a = EventTransferSentSuccess(2)\n- b = EventTransferSentSuccess(2)\n- c = EventTransferSentSuccess(3)\n+ a = EventTransferSentSuccess(2, 5, sha3('target'))\n+ b = EventTransferSentSuccess(2, 5, sha3('target'))\n+ c = EventTransferSentSuccess(3, 4, sha3('target'))\n \n assert a == b\n assert not a != b\n\nCallgraph: \t[test_event_operators->[sha3,EventTransferSentSuccess,EventTransferReceivedSuccess,EventTransferSentFailed],test_transfer_statechange_operators->[ReceiveTransferDirect,ActionTransferDirect,ActionCancelTransfer,Block],test_message_operators->[Ack],test_state_operators->[RouteState,LockedTransferState,RoutesState],sha3]\nCodereview: ", "role": "user" }, { "content": "could you add a `d = EventTransferSentSuccess(3, 4, sha3('differenttarget'))` and assert on it being non-equal to `c`? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -43,6 +43,13 @@ namespace Content.Server.GameObjects.Components.Metabolism\n serializer.DataField(this, b => b.NeedsGases, \"needsGases\", new Dictionary<Gas, float>());\n serializer.DataField(this, b => b.ProducesGases, \"producesGases\", new Dictionary<Gas, float>());\n serializer.DataField(this, b => b.DeficitGases, \"deficitGases\", new Dictionary<Gas, float>());\n+ serializer.DataField(this, b => b.MetabolismHeat, \"metabolismHeat\", 0);\n+ serializer.DataField(this, b => b.RadiatedHeat, \"radiatedHeat\", 0);\n+ serializer.DataField(this, b => b.SweatHeatRegulation, \"sweatHeatRegulation\", 0);\n+ serializer.DataField(this, b => b.ShiveringHeatRegulation, \"shiveringHeatRegulation\", 0);\n+ serializer.DataField(this, b => b.ImplicitHeatRegulation, \"implicitHeatRegulation\", 0);\n+ serializer.DataField(this, b => b.NormalBodyTemperature, \"normalBodyTemperature\", 0);\n+ serializer.DataField(this, b => b.ThermalRegulationTemperatureThreshold, \"thermalRegulationTemperatureThreshold\", 0);\n serializer.DataField(ref _suffocationDamage, \"suffocationDamage\", 1);\n }\n \n\nCallgraph: \t[MetabolismComponent->[ProcessGases->[NeedsAndDeficit,ClampDeficit,GasProduced],GasProduced->[GasProducedMultiplier],GasMixture->[Transfer],Update->[ProcessGases,ProcessNutrients],ExposeData->[ExposeData]]]\nCodereview: ", "role": "user" }, { "content": "Maybe you should give those default values some sane numbers other than 0, just in case someone forgets to set them </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -120,8 +120,8 @@ public class DefaultCompositeByteBuf extends AbstractByteBuf implements Composit\n final int capacity = components.get(numComponents - 1).endOffset + readableBytes;\n \n ByteBuf consolidated = buffer.unsafe().newBuffer(capacity);\n- for (int i = 0; i < numComponents; i ++) {\n- ByteBuf b = components.get(i).buf;\n+ for (Component component : components) {\n+ ByteBuf b = component.buf;\n consolidated.writeBytes(b);\n b.unsafe().release();\n }\n\nCallgraph: \t[DefaultCompositeByteBuf->[toByteIndex->[checkComponentIndex],getLong->[getLong,getInt],getBytes->[toComponentIndex,capacity,getBytes],removeComponents->[checkComponentIndex,updateComponentOffsets],setInt->[setShort,setInt],removeComponent->[checkComponentIndex,updateComponentOffsets],isDirect->[isDirect],toNioBuffer->[nioBuffer,hasNioBuffer],component->[checkComponentIndex],getInt->[getInt,getShort],addComponent->[addComponent,addComponents],getByte->[getByte],hasArray->[hasArray],copyTo->[capacity,getBytes],nioBuffer->[nioBuffer],CompositeUnsafe->[newBuffer->[DefaultCompositeByteBuf,addComponent],release->[release],nioBuffers->[nioBuffer],discardSomeReadBytes->[discardReadComponents],nioBuffer->[nioBuffer]],hasNioBuffer->[hasNioBuffer],copy->[toComponentIndex,capacity],discardReadBytes->[toComponentIndex,capacity,updateComponentOffsets],capacity->[addComponent,capacity],addComponents->[addComponent,addComponents],getUnsignedMedium->[getByte,getShort,getUnsignedMedium],consolidate->[checkComponentIndex,numComponents,updateComponentOffsets],discardReadComponents->[toComponentIndex,capacity,updateComponentOffsets],setShort->[setShort,setByte],setMedium->[setShort,setMedium,setByte],nioBuffers->[toComponentIndex,capacity,nioBuffers],setByte->[setByte],arrayOffset->[arrayOffset],array->[array],findComponent->[capacity],setBytes->[toComponentIndex,capacity,setBytes],toComponentIndex->[capacity],setLong->[setInt,setLong],getShort->[getByte,getShort],toString->[toString],iterator->[iterator]]]\nCodereview: ", "role": "user" }, { "content": "Wouldn't this create a new iterator which adds some GC pressure? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -155,6 +155,10 @@ class RefactoringChecker(checkers.BaseTokenChecker):\n 'if a key is present or a default if not, is simpler and considered '\n 'more idiomatic, although sometimes a bit slower'\n ),\n+ 'R1716': ('simplify chained comparison',\n+ 'chained-comparison',\n+ 'Chained comparisons like \"a < b and b < c\" can be simplified as \"a < b < c\"',\n+ ),\n }\n options = (('max-nested-blocks',\n {'default': 5, 'type': 'int', 'metavar': '<int>',\nCallgraph: \t[RefactoringChecker->[leave_module->[_init],_check_consider_merging_isinstance->[_duplicated_isinstance_types],__init__->[__init__],visit_augassign->[_check_consider_using_join],visit_if->[_check_superfluous_else_return,_check_simplifiable_if,_check_consider_get],_check_swap_variables->[_is_simple_assignment],visit_for->[_check_redefined_argument_from_local],_check_nested_blocks->[_is_actual_elif],_is_node_return_ended->[_is_node_return_ended],_check_consider_get->[type_and_name_are_equal],_check_superfluous_else_return->[_is_actual_elif,_if_statement_is_always_returning],visit_assign->[_check_swap_variables],_check_raising_stopiteration_in_generator_next_call->[_looks_like_infinite_iterator],visit_boolop->[_check_consider_using_in,_check_consider_merging_isinstance],visit_with->[_check_redefined_argument_from_local],_check_simplifiable_if->[_is_actual_elif,_is_bool_const],visit_excepthandler->[_check_redefined_argument_from_local]],_if_statement_is_always_returning->[_has_return_node->[_if_statement_is_always_returning],_has_return_node,_all_elements_are_true],RecommandationChecker->[visit_for->[_is_builtin]],is_trailing_comma->[get_curline_index_start],LenChecker->[visit_compare->[_is_len_call,_is_constant_zero,_has_constant_value,_node_is_test_condition],visit_call->[_is_len_call,_node_is_test_condition],visit_unaryop->[_is_len_call]],register->[RefactoringChecker,RecommandationChecker,NotChecker,LenChecker]]\nCodereview: ", "role": "user" } ]
03d2d664448693b3
{ "callgraph": "[No CFG could be retrieved]", "msg": "can you replace the tabs with 2 spaces please to match the rest of the project?", "patch": "@@ -14,3 +14,17 @@ function roots_get_search_form($form) {\n return $form;\n }\n add_filter('get_search_form', 'roots_get_search_form');\n+\n+/**\n+ * Add page slug to body_class() classes if it doesn't exist\n+ */\n+function roots_body_class($classes) {\n+ // Add post/page slug\n+ if (is_single() || is_page() && !is_front_page()) {\n+ \tif (!in_array(basename(get_permalink()), $classes)) {\n+ \t\t$classes[] = basename(get_permalink());\n+ \t}\n+ }\n+ return $classes;\n+}\n+add_filter('body_class', 'roots_body_class');", "summary": "Get search form from roots." }
[ { "content": "Please Give FORMAL Codereview for software developers in one sentence from the given diff hunk. Don’t start with Codereview/review. Just give the answer. Five examples are given before with code and code review and the code to work on is given after.", "role": "user" }, { "content": "Code: \t@@ -14,3 +14,17 @@ export function useResourcesNotify() {\n }\n });\n }\n+\n+/**\n+ * Combines multiple refs to pass into `ref` prop.\n+ * @param {...any} refs\n+ * @return {function(!Element)}\n+ */\n+export function refs(...refs) {\n+ return (element) => {\n+ for (let i = 0; i < refs.length; i++) {\n+ const ref = refs[i];\n+ typeof ref == 'function' ? ref(element) : (ref.current = element);\n+ }\n+ };\n+}\n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "Use `useCallback` to avoid trashing the ref. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -804,9 +804,10 @@ export class NextPageService {\n * Add the provided page metadata into the queue of\n * pages to fetch\n * @param {!Array<!./page.PageMeta>} pages\n+ * @param {boolean} preventFetching\n * @return {!Promise}\n */\n- queuePages_(pages) {\n+ queuePages_(pages, preventFetching = false) {\n if (!pages.length || this.finished_) {\n return Promise.resolve();\n }\n\nCallgraph: \t[NextPageService->[fetchPageDocument->[text,write,xhrFor,user,url,close,open,validateUrl],initializePageQueue_->[userAssert,user,length,resolve],constructor->[viewportForDoc,templatesFor,mutatorForDoc,win],maybeFetchNext->[fetch,resolve,QUEUED,FAILED,FETCHING,is],sanitizeDoc->[querySelectorAll,removeElement,toArray,body],refreshDefaultRecBox_->[href,dev,htmlFor,addEventListener,html,appendChild,preventDefault,htmlRefs,triggerAnalyticsEvent,image,url,isLoaded,FETCHING,is,title,removeChildren,src,textContent,forEach],createDocumentContainerForPage->[dev,relativePos,classList,appendChild],attachDocumentToPage->[installStylesForDoc,then,resolve,escapeCssSelectorIdent,dev,PRERENDER,PAUSED,replaceChild,getBody,is,devAssert,classList,container,insertAtStart,ampdoc,scopedQuerySelector],getRecBox_->[childElementByAttr],whenFirstScroll_->[resolve,unlisten],getSeparatorElement_->[setAttribute,hasAttribute,childElementByAttr,removeElement],getRemotePages_->[user,ALL,resolve,batchFetchJsonFor],resumePausedPages_->[all,max,min,PAUSED,is,resume,map],toggleHiddenAndReplaceableElements->[getAttribute,setAttribute,querySelectorAll,toArray,random,String,now,toggle,floor],buildDefaultSeparator_->[htmlFor,html],updateVisibility->[findIndex,HIDDEN,OUTSIDE_VIEWPORT,LEAVING_VIEWPORT,relativePos,setVisibility,devAssert,document,isVisible,VISIBLE],getHost_->[dev],queuePages_->[resolve,validatePage,user,url,forEach,length,initialUrl],createHostPage->[parseSchemaImage,parseFavicon,INSERTED,parseOgImage,VISIBLE],buildDefaultRecBox_->[htmlFor,html],hidePreviousPages_->[HIDDEN,all,OUTSIDE_VIEWPORT,pause,relativePos,filter,setVisibility,isVisible],getPageIndex_->[dev,indexOf],maybeRenderSeparatorTemplate_->[removeChildren,resolve,image,dev,appendChild,url,title],getInlinePages_->[childElementsByTag,userAssert,user,removeElement,textContent,tryParseJson,length,isJsonScriptTag],getViewportsAway_->[round],build->[resolve,timerFor,parseInt,user,extensionsFor,ampdocServiceFor,historyForDoc,insertAtStart,navigationForDoc],closeDocument->[resolve,escapeCssSelectorIdent,setStyles,dev,/*REVIEW*/,PAUSED,replaceChild,is,classList,container,scopedQuerySelector],setTitlePage->[dev,triggerAnalyticsEvent],renderRecBoxTemplate_->[removeChildren,image,dev,appendChild,url,isLoaded,FETCHING,is,devAssert,title]],resolve]\nCodereview: ", "role": "user" }, { "content": "Instead of using a boolean parameter, can we rename this method `fetchAndQueuePages` which calls a more concise version of `queuePages_` that we can use above? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -422,6 +422,17 @@ function triggerRenderStart(opt_data) {\n */\n function observeIntersection(observerCallback) {\n // Send request to received records.\n+ if (window.IntersectionObserver && window.IntersectionObserver.prototype) {\n+ // use native IntersectionObserver if exist\n+ const io = new window.IntersectionObserver(changes => {\n+ observerCallback(changes);\n+ }, {\n+ threshold: DEFAULT_THRESHOLD,\n+ });\n+ io.observe(window.document.documentElement);\n+ const unlistener = () => io.unobserve(window.document.documentElement);\n+ return unlistener;\n+ }\n nonSensitiveDataPostMessage('send-intersections');\n return listenParent(window, 'intersection', data => {\n observerCallback(data.changes);\n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "return in the above line? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -318,7 +318,16 @@ export function getParentWindow(win) {\n * @return {!Window}\n */\n export function getTopWindow(win) {\n- return win.__AMP_TOP || win;\n+ const top = win.__AMP_TOP;\n+ if (top === null) {\n+ return win;\n+ }\n+ if (top != null) {\n+ return top;\n+ }\n+ // Make this defined but null to speed up future lookups.\n+ win.__AMP_TOP = null;\n+ return win;\n }\n \n /**\n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "We could set this to `win` instead? Then keep the same `||`: `win.__AMP_TOP || (win.__AMP_TOP = win)` </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -318,8 +318,14 @@ const addReturnValueToEvent = (event) => {\n })\n }\n \n+let warnedAboutRendererProcessReuse = false\n+\n // Add JavaScript wrappers for WebContents class.\n WebContents.prototype._init = function () {\n+ if (!warnedAboutRendererProcessReuse && app._allowRendererProcessReuseIsDefaultValue) {\n+ deprecate.log('The default value of app.allowRendererProcessReuse is deprecated, it is currently \"false\". It will change to be \"true\" in Electron 9. For more information please check https://github.com/electron/electron/issues/18397')\n+ warnedAboutRendererProcessReuse = true\n+ }\n // The navigation controller.\n NavigationController.call(this, this)\n \n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "want to use `deprecate.warnOnce` or similar? that pays attention to `process.noDeprecation` </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -14,3 +14,17 @@ function roots_get_search_form($form) {\n return $form;\n }\n add_filter('get_search_form', 'roots_get_search_form');\n+\n+/**\n+ * Add page slug to body_class() classes if it doesn't exist\n+ */\n+function roots_body_class($classes) {\n+ // Add post/page slug\n+ if (is_single() || is_page() && !is_front_page()) {\n+ \tif (!in_array(basename(get_permalink()), $classes)) {\n+ \t\t$classes[] = basename(get_permalink());\n+ \t}\n+ }\n+ return $classes;\n+}\n+add_filter('body_class', 'roots_body_class');\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" } ]
567e3ca0398070bd
{ "callgraph": "[No CFG could be retrieved]", "msg": "Please explain why a user would enable this (space savings), and the requirements for this option to be safe.", "patch": "@@ -67,6 +67,10 @@ type Config struct {\n \t// If not set, it uses all versions available.\n \t// Warning: This API should not be considered stable and will change soon.\n \tVersions []protocol.VersionNumber\n+\t// Ask the server to truncate the connection ID sent in the Public Header.\n+\t// This saves 8 bytes in the Public Header in every packet. However, if the IP address of the server changes, the connection cannot be migrated.\n+\t// Currently only valid for the client.\n+\tRequestConnectionIDTruncation bool\n }\n \n // A Listener for incoming QUIC connections", "summary": " type is the constructor for a single config field." }
[ { "content": "Please Give FORMAL Codereview for software developers in one sentence from the given diff hunk. Don’t start with Codereview/review. Just give the answer. Five examples are given before with code and code review and the code to work on is given after.", "role": "user" }, { "content": "Code: \t@@ -346,6 +346,10 @@ type ServiceAccountConfig struct {\n \t// Each key is tried in order until the list is exhausted or verification succeeds.\n \t// If no keys are specified, no service account authentication will be available.\n \tPublicKeyFiles []string\n+\n+\t// MasterCA is the CA for verifying the TLS connection back to the master. The service account controller will automatically\n+\t// inject the contents of this file into pods so they can verify connections to the master.\n+\tMasterCA string\n }\n \n type TokenConfig struct {\n\nCallgraph: \t[NewStringSet]\nCodereview: ", "role": "user" }, { "content": "I just realized that the OAuth config also needs this (and is currently incorrectly using servingInfo.clientCA instead - see `GetAPIServerCertCAPool`)... do we want this field replicated in several places, or a single top-level field? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -38,6 +38,12 @@ type Config struct {\n \t// step if not specified.\n \tDefaultEvaluationInterval time.Duration\n \n+\t// Directory for ActiveQueryTracker. If empty, ActiveQueryTracker will be disabled and MaxConcurrent will not be applied (!).\n+\t// ActiveQueryTracker logs queries that were active during the last crash, but logs them on the next startup.\n+\t// However, we need to use active query tracker, otherwise we cannot limit Max Concurrent queries in the PromQL\n+\t// engine.\n+\tActiveQueryTrackerDir string `yaml:\"active_query_tracking_dir\"`\n+\n \t// For testing, to prevent re-registration of metrics in the promql engine.\n \tmetricsRegisterer prometheus.Registerer `yaml:\"-\"`\n }\n\nCallgraph: \t[Err->[Err],LabelNames->[LabelNames],Next->[Next],At->[At],LabelValues->[LabelValues],Select->[Select]]\nCodereview: ", "role": "user" }, { "content": "`active_query_tracking_dir` > `active_query_tracker_dir` to be consistent with the CLI flag. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -234,6 +234,9 @@ type SecureServingInfo struct {\n \t// HTTP2MaxStreamsPerConnection is the limit that the api server imposes on each client.\n \t// A value of zero means to use the default provided by golang's HTTP/2 support.\n \tHTTP2MaxStreamsPerConnection int\n+\n+\t// HTTP1Only indicates that http2 should not be enabled.\n+\tHTTP1Only bool\n }\n \n type AuthenticationInfo struct {\n\nCallgraph: \t[HostPort->[SplitHostPort,Addr,String,Errorf,Atoi],New->[AddPostStartHookOrDie,LoadInt64,PreShutdownHooks,CompareAndSwapInt64,isPostStartHookRegistered,AddPostStartHook,Name,BuildHandlerChainFunc,NewRootAPIsHandler,Duration,Start,HealthzChecks,UnprotectedHandler,NotFoundHandler,Errorf,PostStartHooks],Complete->[Strings,Itoa,SplitHostPort,JoinHostPort,String,Fatalf,HostPort,Split,Complete],Duration,Unauthorized,Enabled,WithRequestInfo,SetBlockProfileRate,Add,WithMaxInFlightLimit,WebService,New,WithImpersonation,NewString,WithFailedAuthenticationAudit,WithWaitGroup,BasicLongRunningRequestCheck,WithCORS,WithAudit,WithPanicRecovery,StringFlagPutHandler,WithTimeoutForNonLongRunningRequests,WithAuthorization,NewFromTokens,WithAuthentication,Install,NewRandom,NewPrivilegedGroups,Insert,String,Trim]\nCodereview: ", "role": "user" }, { "content": "phrased negatively so the default `false` works. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -187,6 +187,9 @@ type TestParameters struct {\n \t// set to true to use production run mode in tests\n \tUseProductionRunMode bool\n \n+\t// Set to override the Keybase API server URI in a test.\n+\tServerURI string\n+\n \t// whether LogoutIfRevoked check should be skipped to avoid races\n \t// during resets.\n \tSkipLogoutIfRevokedCheck bool\n\nCallgraph: \t[GetGpgHome->[GetGpgHome,GetString,GetConfig,GetHome],GetInfoDir->[GetString],GetPvlKitFilename->[GetString,GetConfig,GetPvlKitFilename],GetLevelDBNumFiles->[getEnvInt,GetConfig,GetInt],GetGpg->[GetString,GetConfig,GetGpg],GetUpdatePreferenceSkip->[GetUpdatePreferenceSkip,GetConfig],GetLogFormat->[GetString,GetLogFormat,GetConfig],GetSlowGregorConn->[GetBool,GetSlowGregorConn,GetConfig,getEnvBool],GetLogPrefix->[GetLogPrefix],GetAttachmentDisableMulti->[GetBool,GetConfig,getEnvBool],getHomeFromCmdOrConfig->[GetString,GetConfig,GetHome],GetInstallID->[GetInstallID,GetUpdaterConfig],GetGregorDisabled->[GetGregorDisabled,GetBool,GetConfig],GetStoredSecretServiceName->[GetRunMode],GetKBFSInfoPath->[GetRuntimeDir],DarwinForceSecretStoreFile->[GetRunMode],GetSecretKeyringTemplate->[GetString,GetConfig,GetConfigDir,GetSecretKeyringTemplate],GetChatMemberType->[GetString],GetDbFilename->[GetDataDir,GetString,GetConfig,GetDbFilename],GetScraperTimeout->[GetConfig,getEnvDuration,GetDuration,GetScraperTimeout],GetGregorURI->[GetString,GetGregorURI,GetConfig,GetRunMode],GetServiceInfoPath->[GetRuntimeDir],GetMountDir->[GetString,GetConfig,GetRunMode,GetMountDir],GetDebug->[GetDebug,GetBool,GetConfig,getEnvBool],IsMobileExtension->[IsMobileExtension,GetBool,GetConfig,getEnvBool],GetPayloadCacheSize->[getEnvInt,GetConfig,GetInt],GetGpgOptions->[GetStringList,GetConfig,GetGpgOptions],GetServiceType->[GetString],GetProxy->[GetString,GetConfig,GetProxy],GetChatOutboxStorageEngine->[GetString,GetChatOutboxStorageEngine,GetConfig],GetUIDMapFullNameCacheSize->[getEnvInt,GetConfig,GetInt],GetGregorPingTimeout->[GetGregorPingTimeout,GetConfig,getEnvDuration,GetDuration],GetStandalone->[GetBool,GetStandalone,GetConfig,getEnvBool],GetLinkCacheSize->[getEnvInt,GetConfig,GetInt],GetTimers->[GetString,GetConfig,GetTimers],GetDefaultLogFile->[GetLogDir],GetUpdateLastChecked->[GetUpdateLastChecked,GetConfig],GetNoPinentry->[GetPinentry,GetBool,GetConfig,GetNoPinentry],GetConvSourceType->[GetString],SetUpdatePreferenceAuto->[SetUpdatePreferenceAuto,GetConfigWriter],WantsSystemd->[GetRunMode],GetTorProxy->[GetString,GetConfig,GetTorProxy],AllowPTrace->[GetBool,getEnvBool],GetUpdatePreferenceAuto->[GetUpdatePreferenceAuto,GetConfig],GetGregorPingInterval->[GetGregorPingInterval,GetConfig,getEnvDuration,GetDuration],GetUPAKCacheSize->[getEnvInt,GetConfig,GetInt],GetProofCacheLongDur->[GetConfig,getEnvDuration,GetDuration],GetProofCacheMediumDur->[GetConfig,getEnvDuration,GetDuration],SetUpdatePreferenceSkip->[SetUpdatePreferenceSkip,GetConfigWriter],GetServerURI->[GetString,GetConfig,GetServerURI,GetRunMode],GetProofCacheShortDur->[GetConfig,getEnvDuration,GetDuration],GetUsername->[GetConfig,GetUsername],GetRunModeAsString->[GetRunMode],GetProofCacheSize->[getEnvInt,GetConfig,GetInt],GetSocketBindFile->[GetString],GetSocketDialFiles->[defaultSocketFile,sandboxSocketFile],SetUpdatePreferenceSnoozeUntil->[SetUpdatePreferenceSnoozeUntil,GetConfigWriter],GetConfigFilename->[GetString,GetConfig,GetConfigDir,GetConfigFilename],GetAttachmentHTTPStartPort->[getEnvInt,GetConfig,GetInt],RememberPassphrase->[GetBool,GetConfig],GetDeviceIDForUID->[GetDeviceIDForUID,GetConfig],GetDeviceIDForUsername->[GetConfig,GetDeviceIDForUsername],SetUpdateLastChecked->[SetUpdateLastChecked,GetConfigWriter],GetDisplayRawUntrustedOutput->[GetDisplayRawUntrustedOutput,GetBool,GetConfig,getEnvBool],GetUseDefaultLogFile->[GetBool,getEnvBool],GetLocalTrackMaxAge->[GetLocalTrackMaxAge,GetConfig,getEnvDuration,GetDuration],GetUpdateDisabled->[GetConfig,GetUpdateDisabled],GetAvatarSource->[GetString],GetChatDbFilename->[GetDataDir,GetString,GetConfig,GetChatDbFilename],GetRuntimeDir->[GetString],GetUserCacheMaxAge->[GetUserCacheMaxAge,getEnvDuration,GetDuration,GetConfig],GetUID->[GetConfig,GetUID],GetBundledCA->[GetString,GetConfig,GetBundledCA],GetParamProofKitFilename->[GetString,GetConfig,GetParamProofKitFilename],GetAllowRoot->[GetBool,getEnvBool],getMobileSharedHomeFromCmdOrConfig->[GetString,GetConfig,GetMobileSharedHome],RunningInCI->[GetBool,getEnvBool],GetUpdaterConfigFilename->[GetUpdaterConfigFilename,GetString,GetConfig,GetConfigDir],GetUsernameForUID->[GetUsernameForUID,GetConfig],GetChatDelivererInterval->[GetChatDelivererInterval,getEnvDuration,GetDuration,GetConfig],GetTorHiddenAddress->[GetString,GetConfig,GetTorHiddenAddress],GetPinentry->[GetString,GetConfig,GetPinentry],GetLinkCacheCleanDur->[GetConfig,getEnvDuration,GetDuration],GetPidFile->[GetString,GetConfig,GetPidFile,GetInfoDir],GetLogFile->[GetString,GetLogFile],GetTorMode->[GetConfig,GetTorMode],GetUpdateURL->[GetConfig,GetUpdateURL],GetAPITimeout->[GetAPITimeout,GetConfig,getEnvDuration,GetDuration],GetDeviceID->[GetConfig,GetDeviceID],defaultSocketFile->[GetString,GetConfig,GetRuntimeDir,GetSocketFile],GetBGIdentifierDisabled->[GetBool,GetBGIdentifierDisabled,GetConfig],GetDoLogForward->[GetLocalRPCDebug],GetAPIDump->[GetBool,GetAPIDump,getEnvBool],GetAutoFork->[GetAutoFork,getEnvBool,GetNegBool,GetNoAutoFork,GetConfig],GetLabel->[GetString],GetSessionFilename->[GetString,GetSessionFilename,GetCacheDir,GetConfig],GetCodeSigningKIDs->[GetStringList,getEnvPath,GetCodeSigningKIDs,GetConfig,GetRunMode],GetEmailOrUsername->[GetEmail,GetUsername],GetGregorSaveInterval->[GetGregorSaveInterval,GetConfig,getEnvDuration,GetDuration],GetDisableTeamAuditor->[GetBool,GetConfig,getEnvBool],GetUpdatePreferenceSnoozeUntil->[GetConfig,GetUpdatePreferenceSnoozeUntil],GetVDebugSetting->[GetVDebugSetting,GetString,GetConfig],GetEmail->[GetString],GetReadDeletedSigChain->[GetBool,GetReadDeletedSigChain,GetConfig,getEnvBool],GetLocalRPCDebug->[GetString,GetConfig,GetLocalRPCDebug],GetRunMode->[GetConfig,GetRunMode],GetInboxSourceType->[GetString],GetMerkleKIDs->[GetStringList,GetMerkleKIDs,getEnvPath,GetConfig,GetRunMode],GetAppType->[GetConfig,GetAppType],GetDeviceCloneStateFilename->[GetString,GetConfig,GetDeviceCloneStateFilename,GetConfigDir],GetChatInboxSourceLocalizeThreads->[getEnvInt,GetConfig,GetInt],GetFeatureFlags->[GetFeatureFlags,GetConfig],GetStoredSecretAccessGroup->[GetBool,GetSecurityAccessGroupOverride,GetConfig],GetRunMode]\nCodereview: ", "role": "user" }, { "content": "do you need this or is it sufficient to just set the URI via env? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -294,6 +294,16 @@ type MasterConfig struct {\n \t// JenkinsPipelineConfig holds information about the default Jenkins template\n \t// used for JenkinsPipeline build strategy.\n \tJenkinsPipelineConfig JenkinsPipelineConfig\n+\n+\t// AuditConfig holds information related to auditing capabilities.\n+\tAuditConfig AuditConfig\n+}\n+\n+// AuditConfig holds configuration for the audit capabilities\n+type AuditConfig struct {\n+\t// If this flag is set, audit log will be printed in the logs.\n+\t// The logs contains, method, user and a requested URL.\n+\tEnabled bool\n }\n \n // JenkinsPipelineConfig holds configuration for the Jenkins pipeline strategy\n\nCallgraph: \t[StringKeySet,NewString]\nCodereview: ", "role": "user" }, { "content": "Let's just call this `Enabled`. In the future we can add handler configs for the destinations (basic, files, events, etc) and keep this master flag for the on/off. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -67,6 +67,10 @@ type Config struct {\n \t// If not set, it uses all versions available.\n \t// Warning: This API should not be considered stable and will change soon.\n \tVersions []protocol.VersionNumber\n+\t// Ask the server to truncate the connection ID sent in the Public Header.\n+\t// This saves 8 bytes in the Public Header in every packet. However, if the IP address of the server changes, the connection cannot be migrated.\n+\t// Currently only valid for the client.\n+\tRequestConnectionIDTruncation bool\n }\n \n // A Listener for incoming QUIC connections\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" } ]
816a4a84590c61b2
{ "callgraph": "[testCanClickOnALinkThatOverflowsAndFollowIt->[title_is,WebDriverWait,find_element],loadPage->[load],testClickingALinkMadeUpOfNumbersIsHandledCorrectly->[title_is,WebDriverWait,find_element],fixture]", "msg": "I believe it's misleading name for the condition. I prefer \"element_to_be_disable\" We can have a condition, when element is enabled but we can't click it, because another element overlays above it. So, If we use \"unclickable\" we might mislead people, who use that condition to verify if element can be clicked", "patch": "@@ -35,3 +35,6 @@ def testCanClickOnALinkThatOverflowsAndFollowIt(driver):\n def testClickingALinkMadeUpOfNumbersIsHandledCorrectly(driver):\n driver.find_element(By.LINK_TEXT, \"333333\").click()\n WebDriverWait(driver, 3).until(EC.title_is(\"XHTML Test Page\"))\n+\n+def testCannotClickDisabledButton(driver):\n+ WebDriverWait(driver, 3).until(EC.element_to_be_unclickable(By.ID, \"disabled-button\"))", "summary": "Clicks a link with a text that is a link that is made up of numbers and." }
[ { "content": "Please Give FORMAL Codereview for software developers in one sentence from the given diff hunk. Don’t start with Codereview/review. Just give the answer. Five examples are given before with code and code review and the code to work on is given after.", "role": "user" }, { "content": "Code: \t@@ -241,6 +241,17 @@ def wait_until_render_complete(driver):\n from selenium.webdriver.support.ui import WebDriverWait\n from selenium.common.exceptions import TimeoutException\n \n+ def is_bokeh_loaded(driver):\n+ return driver.execute_script('''\n+ const b = window.Bokeh;\n+ return b && b.documents && b.documents.length > 0;\n+ ''')\n+\n+ try:\n+ WebDriverWait(driver, 5, poll_frequency=0.1).until(is_bokeh_loaded)\n+ except TimeoutException as e:\n+ raise_from(RuntimeError('Bokeh was not loaded in time. Something may have gone wrong.'), e)\n+\n driver.execute_script(_WAIT_SCRIPT)\n \n def is_bokeh_render_complete(driver):\n\nCallgraph: \t[wait_until_render_complete->[is_bokeh_render_complete->[execute_script],WebDriverWait,get,len,execute_script,get_log,format,warn],get_screenshot_as_png->[import_required,wait_until_render_complete,get_screenshot_as_png,_tmp_file,get,save_layout_html,execute_script,maximize_window,BytesIO,_crop_image,_create_default_webdriver,open,terminate_web_driver],export_svgs->[find,write,append,default_filename,len,get_svgs,format,warn,enumerate,open],_tmp_file->[NamedTemporaryFile],get_svgs->[wait_until_render_complete,_tmp_file,get,save_layout_html,execute_script,_create_default_webdriver,terminate_web_driver],export_png->[default_filename,save,abspath,get_screenshot_as_png],save_layout_html->[save,isinstance,get,warn],_crop_image->[crop],_create_default_webdriver->[import_required,PhantomJS,detect_phantomjs],terminate_web_driver->[send_signal,quit],dev,getLogger,general]\nCodereview: ", "role": "user" }, { "content": "Should this be in a `try/except` block, that converts the timeout exception into a `RuntimeError` with a more Bokeh-specific message? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -35,7 +35,6 @@ def AssembleTestSuites():\n smallSuite.addTests(KratosUnittest.TestLoader().loadTestsFromTestCases([test_trilinos_linear_solvers.TestLinearSolvers]))\n smallSuite.addTests(KratosUnittest.TestLoader().loadTestsFromTestCases([test_trilinos_matrix.TestTrilinosMatrix]))\n smallSuite.addTests(KratosUnittest.TestLoader().loadTestsFromTestCases([test_trilinos_redistance.TestTrilinosRedistance]))\n- smallSuite.addTests(KratosUnittest.TestLoader().loadTestsFromTestCases([test_trilinos_redistance.TestTrilinosRedistanceInMemory]))\n smallSuite.addTests(KratosUnittest.TestLoader().loadTestsFromTestCases([test_trilinos_levelset_convection.TestTrilinosLevelSetConvection]))\n smallSuite.addTests(KratosUnittest.TestLoader().loadTestsFromTestCases([test_trilinos_levelset_convection.TestTrilinosLevelSetConvectionInMemory]))\n \n\nCallgraph: \t[AssembleTestSuites->[TestLoader,addTests],AssembleTestSuites,runTests]\nCodereview: ", "role": "user" }, { "content": "why do you remove this test? IIRC this was intended to check the partitioner however I agree that this is not the place to put such a test :D Seeing that you changed the test to use the in memory partitioner I am ok with it (also a student of mine is currently writing some tests for the partitioner itself :) ) FYI @roigcarlo </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -35,7 +35,6 @@ module Telephony\n \n private\n \n- # rubocop:disable all\n def adapter\n case [Telephony.config.adapter, channel.to_sym]\n when [:pinpoint, :sms]\n\nCallgraph: \t[OtpSender->[log_response->[adapter],adapter->[adapter]]]\nCodereview: ", "role": "user" }, { "content": "There's a matching `# rubocop:enable all` below. Should it be removed? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -35,7 +35,6 @@ module Telephony\n \n private\n \n- # rubocop:disable all\n def adapter\n case [Telephony.config.adapter, channel.to_sym]\n when [:pinpoint, :sms]\n\nCallgraph: \t[OtpSender->[log_response->[adapter],adapter->[adapter]]]\nCodereview: ", "role": "user" }, { "content": "There's a matching `# rubocop:enable all` below. Should it be removed? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -35,9 +35,6 @@ files = [\n \n \n class FineGrainedSuite(DataSuite):\n- def __init__(self, *, update_data: bool) -> None:\n- pass\n-\n @classmethod\n def cases(cls) -> List[DataDrivenTestCase]:\n c = [] # type: List[DataDrivenTestCase]\n\nCallgraph: \t[find_steps->[group,walk,split,int,max,sub,setdefault,join,range,match],FineGrainedSuite->[run_case->[,build,FineGrainedBuildManager,find_steps,append,sub,assert_string_arrays_equal,extend,update,copy,replace,escape,join],cases->[parse_test_cases,join],build->[Options,build,str,join,BuildSource]]]\nCodereview: ", "role": "user" }, { "content": "Or did you want here a call to `super().__init__`? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -35,3 +35,6 @@ def testCanClickOnALinkThatOverflowsAndFollowIt(driver):\n def testClickingALinkMadeUpOfNumbersIsHandledCorrectly(driver):\n driver.find_element(By.LINK_TEXT, \"333333\").click()\n WebDriverWait(driver, 3).until(EC.title_is(\"XHTML Test Page\"))\n+\n+def testCannotClickDisabledButton(driver):\n+ WebDriverWait(driver, 3).until(EC.element_to_be_unclickable(By.ID, \"disabled-button\"))\nCallgraph: \t[testCanClickOnALinkThatOverflowsAndFollowIt->[title_is,WebDriverWait,find_element],loadPage->[load],testClickingALinkMadeUpOfNumbersIsHandledCorrectly->[title_is,WebDriverWait,find_element],fixture]\nCodereview: ", "role": "user" } ]
4757eb9940585aa7
{ "callgraph": "[PathTemplateCheckView->[newBuilder->[Builder]]]", "msg": "Should this be called something that indicates its function, rather than its content? validationMessagePrefix, or similar?", "patch": "@@ -23,6 +23,8 @@ public abstract class PathTemplateCheckView {\n \n public abstract String paramName();\n \n+ public abstract String methodName();\n+\n public static Builder newBuilder() {\n return new AutoValue_PathTemplateCheckView.Builder();\n }", "summary": "Creates a builder for a path template check view." }
[ { "content": "Please Give FORMAL Codereview for software developers in one sentence from the given diff hunk. Don’t start with Codereview/review. Just give the answer. Five examples are given before with code and code review and the code to work on is given after.", "role": "user" }, { "content": "Code: \t@@ -81,6 +81,15 @@ public abstract class DataAdapterDto {\n @JsonProperty(FIELD_NAME)\n public abstract Builder name(String name);\n \n+ @JsonProperty(FIELD_CUSTOM_ERROR_TTL_ENABLED)\n+ public abstract Builder customErrorTTLEnabled(@Nullable Boolean enabled);\n+\n+ @JsonProperty(FIELD_CUSTOM_ERROR_TTL)\n+ public abstract Builder customErrorTTL(@Nullable Long ttl);\n+\n+ @JsonProperty(FIELD_CUSTOM_ERROR_TTL_UNIT)\n+ public abstract Builder customErrorTTLUnit(@Nullable TimeUnit unit);\n+\n @JsonProperty(\"content_pack\")\n public abstract Builder contentPack(@Nullable String contentPack);\n \n\nCallgraph: \t[DataAdapterDto->[builder->[Builder]]]\nCodereview: ", "role": "user" }, { "content": "I just thought if we actually need the `custom_error_ttl_enabled` option. Couldn't we just have `error_ttl` and `error_ttl_unit` set those to the default of 5 seconds? That way we would not need a \"custom\" TTL option (no checkbox in the UI), no logic in the `LookupDataAdapter` class contructors to check if the custom TTL is actually enabled and also no hardcoded constant with the default TTL. We cannot use the constant default error result but I guess that's okay because we can build the error result during data adapter construction based on the configuration and reuse that for the lifetime of the data adapter. What do you think? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -144,7 +144,7 @@ public abstract class CommandInterpreter extends Builder {\n return dir.createTextTempFile(\"hudson\", getFileExtension(), getContents(), false);\n }\n \n- public abstract String[] buildCommandLine(FilePath script);\n+ public abstract String[] buildCommandLine(FilePath script, FilePath ws);\n \n protected abstract String getContents();\n \n\nCallgraph: \t[CommandInterpreter->[perform->[perform],join->[join]]]\nCodereview: ", "role": "user" }, { "content": "You cannot compatibly change the signature of an existing API method. You would have to introduce a new overload which called the existing method by default, and which `BatchFile` would override. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -32,6 +32,8 @@ public abstract class AuthenticationDetails {\n return Builder.create();\n }\n \n+ public abstract AuthenticationDetails.Builder toBuilder();\n+\n @AutoValue.Builder\n public abstract static class Builder {\n \n\nCallgraph: \t[AuthenticationDetails->[Builder->[create->[sessionAttributes]]]]\nCodereview: ", "role": "user" }, { "content": "It's nice to have this, but we don't have code calling this. If we decide to keep the PR for the UI changes, we should leave this change in. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -22,6 +22,8 @@ import com.google.auto.value.AutoValue;\n public abstract class LDAPUser {\n public abstract String base64UniqueId();\n \n+ public abstract ADUserAccountControl userAccountControl();\n+\n public abstract String username();\n \n public abstract String fullName();\n\nCallgraph: \t[LDAPUser->[dn->[dn],Builder->[create->[Builder]]]]\nCodereview: ", "role": "user" }, { "content": "I don't think we should put AD specific code into the `LDAPEntry` and `LDAPUser` objects. How about using the `AccountStatus` instead? That makes it independent from AD. We could extract the `AccountStatus` into a separate enum out of the `User` interface to make it a bit more generic. What do you think? I also think we should only have an `accountStatus()` method in `LDAPUser` instead of also putting it into the `LDAPEntry` object. The `LDAPEntry` object is supposed to be generic. We can move the `userAccountControl` parsing into the `createLDAPUser()` method in `UnboundLDAPConnector`. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -298,6 +298,11 @@ public abstract class SqlTransform extends PTransform<PInput, PCollection<Row>>\n return toBuilder().setUdafDefinitions(newUdafs).build();\n }\n \n+ public SqlTransform withErrorsTransformer(\n+ PTransform<PCollection<BeamCalcRelError>, POutput> errorsTransformer) {\n+ return toBuilder().setErrorsTransformer(errorsTransformer).build();\n+ }\n+\n abstract Builder toBuilder();\n \n static Builder builder() {\n\nCallgraph: \t[SqlTransform->[registerUdf->[registerUdf],expand->[queryString,queryParameters,autoLoading,queryPlannerClassName,defaultTableProvider],withTableProvider->[tableProviderMap]]]\nCodereview: ", "role": "user" }, { "content": "Can you make this `PTransform<PCollection<BeamCalcRelError>, ? extends POutput>` instead? (Or really `PTransform<PCollection<Row>, ? extends POutput>`) </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -23,6 +23,8 @@ public abstract class PathTemplateCheckView {\n \n public abstract String paramName();\n \n+ public abstract String methodName();\n+\n public static Builder newBuilder() {\n return new AutoValue_PathTemplateCheckView.Builder();\n }\nCallgraph: \t[PathTemplateCheckView->[newBuilder->[Builder]]]\nCodereview: ", "role": "user" } ]
de9b46b4341d6597
{ "callgraph": "[remove_pe_defaults_on->[remove_platform_pe_defaults],add_pe_defaults_on->[add_platform_pe_defaults]]", "msg": "This winds up flipping the desired values. Looks like I gave you a bum steer @kevpl", "patch": "@@ -32,7 +32,7 @@ module Beaker\n 'puppetbin' => '/opt/puppet/bin/puppet',\n 'puppetbindir' => '/opt/puppet/bin',\n 'puppetsbindir' => '/opt/puppet/sbin',\n- 'privatebindir' => '/opt/puppetlabs/puppet/bin',\n+ 'privatebindir' => '/opt/puppet/bin',\n 'puppetvardir' => '/var/opt/lib/pe-puppet',\n 'hieradatadir' => '/var/lib/hiera',\n 'hieraconf' => '/etc/puppetlabs/puppet/hiera.yaml',", "summary": "The puppet - labs directory is the root of the system. windows windows puppet service." }
[ { "content": "Please Give FORMAL Codereview for software developers in one sentence from the given diff hunk. Don’t start with Codereview/review. Just give the answer. Five examples are given before with code and code review and the code to work on is given after.", "role": "user" }, { "content": "Code: \t@@ -43,6 +43,7 @@ module AlaveteliConfiguration\n :INCOMING_EMAIL_PREFIX => '',\n :INCOMING_EMAIL_SECRET => 'dummysecret',\n :ISO_COUNTRY_CODE => 'GB',\n+ :MINIMUM_REQUESTS_FOR_STATISTICS => 100,\n :MAX_REQUESTS_PER_USER_PER_DAY => '',\n :MTA_LOG_TYPE => 'exim',\n :NEW_RESPONSE_REMINDER_AFTER_DAYS => [3, 10, 24],\n\nCallgraph: \t[AlaveteliConfiguration->[to_sym,has_key?,get,upcase],set_file,const_defined?,dirname,load_default,join,require]\nCodereview: ", "role": "user" }, { "content": "This should be added to conf/general.yml-example too. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -322,6 +322,7 @@ module Engine\n '105' => 'city=revenue:40,slots:3;path=a:0,b:_0,track:dual;path=a:1,b:_0,track:dual;path=a:2,b:_0,track:dual;label=BM',\n '106' => 'junction;path=a:0,b:_0,track:dual;path=a:2,b:_0,track:dual;path=a:4,b:_0,track:dual;path=a:3,b:_0,track:dual',\n '107' => 'junction;path=a:0,b:_0,track:dual;path=a:1,b:_0,track:dual;path=a:3,b:_0,track:dual;path=a:4,b:_0,track:dual',\n+ '108' => 'junction;path=a:0,b:_0,track:dual;path=a:1,b:_0,track:dual;path=a:2,b:_0,track:dual;path=a:3,b:_0,track:dual',\n '118' => 'city=revenue:40;city=revenue:40;path=a:0,b:_0;path=a:_0,b:1;path=a:2,b:_1;path=a:_1,b:3',\n '122' => 'city=revenue:80,slots:2;city=revenue:80,slots:2;path=a:0,b:_0;path=a:_0,b:1;path=a:2,b:_1;path=a:_1,b:3;label=T',\n '125' => 'city=revenue:40,slots:2;path=a:0,b:_0;path=a:1,b:_0;path=a:2,b:_0;path=a:3,b:_0;path=a:4,b:_0',\n\nCallgraph: \t[freeze]\nCodereview: ", "role": "user" }, { "content": "This should be in the game config. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -30,6 +30,7 @@ module Engine\n '56' => 'town=revenue:10;town=revenue:10;path=a:0,b:_0;path=a:_0,b:2;path=a:1,b:_1;path=a:_1,b:3',\n '57' => 'city=revenue:20;path=a:0,b:_0;path=a:_0,b:3',\n '58' => 'town=revenue:10;path=a:0,b:_0;path=a:_0,b:2',\n+ '59s' => 'city=revenue:20;path=a:0,b:_0',\n '69' => 'town=revenue:10;town=revenue:10;path=a:0,b:_0;path=a:_0,b:3;path=a:2,b:_1;path=a:_1,b:4',\n # '71' => 'town=revenue:10;town=revenue:10;path=a:0,b:_0,track:narrow;path=a:_0,b:2,track:narrow',\n '72' => 'town=revenue:10;path=a:0,b:_0,track:narrow;path=a:_0,b:1,track:narrow',\n\nCallgraph: \t[freeze]\nCodereview: ", "role": "user" }, { "content": "Game-specific tiles should not be put into this file. They should go into game/g_1829/map.rb </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -29,7 +29,9 @@ module Search\n },\n \"title\" => hit[\"name\"],\n \"path\" => hit[\"path\"],\n- \"id\" => hit[\"id\"]\n+ \"id\" => hit[\"id\"],\n+ \"class_name\" => \"User\",\n+ \"positive_reactions_count\" => hit[\"positive_reactions_count\"]\n }\n end\n \n\nCallgraph: \t[User->[search_documents->[search,dig,prepare_doc,paginate_hits,as_hash,set_query_size,map],index_settings->[production?],freeze]]\nCodereview: ", "role": "user" }, { "content": "Couple more fields need to render users into the articleHTML template in the main feed. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -53,7 +53,8 @@ module Dependabot\n \"requirements\" => requirements,\n \"previous_version\" => previous_version,\n \"previous_requirements\" => previous_requirements,\n- \"package_manager\" => package_manager\n+ \"package_manager\" => package_manager,\n+ \"metadata\" => metadata\n }\n end\n \n\nCallgraph: \t[Dependency->[hash->[hash],display_name->[display_name_builder_for_package_manager],production?->[top_level?],to_h]]\nCodereview: ", "role": "user" }, { "content": "Might want to call `compact` here, so that setups without metadata don't include that key. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -32,7 +32,7 @@ module Beaker\n 'puppetbin' => '/opt/puppet/bin/puppet',\n 'puppetbindir' => '/opt/puppet/bin',\n 'puppetsbindir' => '/opt/puppet/sbin',\n- 'privatebindir' => '/opt/puppetlabs/puppet/bin',\n+ 'privatebindir' => '/opt/puppet/bin',\n 'puppetvardir' => '/var/opt/lib/pe-puppet',\n 'hieradatadir' => '/var/lib/hiera',\n 'hieraconf' => '/etc/puppetlabs/puppet/hiera.yaml',\nCallgraph: \t[remove_pe_defaults_on->[remove_platform_pe_defaults],add_pe_defaults_on->[add_platform_pe_defaults]]\nCodereview: ", "role": "user" } ]
c2e04cd8e85c8f1f
{ "callgraph": "[Const->[REGISTRY_API->[getRegistryApiVersion,format,equals,getDomainName]]]", "msg": "are you sure you can read version by this artifactid?", "patch": "@@ -148,6 +148,10 @@ public final class Const {\n public static final String PATH_CHECKSESSION = \"checksession\";\n \n public static final String URL_PREFIX = \"urlPrefix\";\n- \n+\n public static final String INSTANCE_PUBKEY_PRO = \"publickey\";\n+\n+ public static final String GROUPID = \"io.servicecomb\";\n+\n+ public static final String ARTIFACTID = \"java-chassis\";\n }", "summary": "Get the path checksession and urlPrefix." }
[ { "content": "Please Give FORMAL Codereview for software developers in one sentence from the given diff hunk. Don’t start with Codereview/review. Just give the answer. Five examples are given before with code and code review and the code to work on is given after.", "role": "user" }, { "content": "Code: \t@@ -75,12 +75,17 @@ public class HiveOrcSerDeManager extends HiveSerDeManager {\n public static final String DEFAULT_SERDE_TYPE = \"ORC\";\n public static final String INPUT_FORMAT_CLASS_KEY = \"hiveOrcSerdeManager.inputFormatClass\";\n public static final String DEFAULT_INPUT_FORMAT_CLASS = OrcInputFormat.class.getName();\n+ public static final String WRITER_LATEST_SCHEMA = \"writer.latest.schema\";\n \n public static final String OUTPUT_FORMAT_CLASS_KEY = \"hiveOrcSerdeManager.outputFormatClass\";\n public static final String DEFAULT_OUTPUT_FORMAT_CLASS = OrcOutputFormat.class.getName();\n \n public static final String HIVE_SPEC_SCHEMA_READING_TIMER = \"hiveOrcSerdeManager.schemaReadTimer\";\n \n+ public static final String HIVE_SPEC_SCHEMA_FROM_WRITER = \"hiveOrcSerdeManager.getSchemaFromWriterSchema\";\n+ public static final boolean DEFAULT_HIVE_SPEC_SCHEMA_FROM_WRITER = false;\n+\n+\n public static final String ENABLED_ORC_TYPE_CHECK = \"hiveOrcSerdeManager.enableFormatCheck\";\n public static final boolean DEFAULT_ENABLED_ORC_TYPE_CHECK = false;\n \n\nCallgraph: \t[HiveOrcSerDeManager->[getSchemaFromLatestFile->[getSchemaFromLatestFile],addSchemaPropertiesHelper->[getSchemaFromLatestFile]]]\nCodereview: ", "role": "user" }, { "content": "Do we need to introduce a config? Can we always look for writer schema first and then default to file schema if it doesn't exist? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -147,7 +147,17 @@ public class ConfigurationKeys {\n public static final String EXTRACT_PRIMARY_KEY_FIELDS_KEY = \"extract.primary.key.fields\";\n public static final String EXTRACT_DELTA_FIELDS_KEY = \"extract.delta.fields\";\n public static final String EXTRACT_SCHEMA = \"extract.schema\";\n- public static final String EXTRACT_PULL_LIMIT = \"extract.pull.limit\";\n+ public static final String EXTRACT_LIMIT_ENABLED_KEY = \"extract.limit.enabled\";\n+ public static final boolean DEFAULT_EXTRACT_LIMIT_ENABLED = false;\n+ public static final String EXTRACT_LIMIT_TYPE_KEY = \"extract.limit.type\";\n+ public static final String EXTRACT_LIMIT_RATE_LIMIT_KEY = \"extract.limit.rate.limit\";\n+ public static final String EXTRACT_LIMIT_RATE_LIMIT_TIMEUNIT_KEY = \"extract.limit.rate.limit.timeunit\";\n+ public static final String DEFAULT_EXTRACT_LIMIT_RATE_LIMIT_TIMEUNIT = TimeUnit.SECONDS.toString();\n+ public static final String EXTRACT_LIMIT_TIME_LIMIT_KEY = \"extract.limit.time.limit\";\n+ public static final String EXTRACT_LIMIT_TIME_LIMIT_TIMEUNIT_KEY = \"extract.limit.time.limit.timeunit\";\n+ public static final String DEFAULT_EXTRACT_LIMIT_TIME_LIMIT_TIMEUNIT = TimeUnit.SECONDS.toString();\n+ public static final String EXTRACT_LIMIT_COUNT_LIMIT_KEY = \"extract.limit.count.limit\";\n+ public static final String EXTRACT_LIMIT_POOL_SIZE_KEY = \"extract.limit.pool.size\";\n \n /**\n * Converter configuration properties.\n\nCallgraph: \t[ConfigurationKeys->[name,toString]]\nCodereview: ", "role": "user" }, { "content": "How about putting the config names in the LimiterFactory class? Then it is very clear where they are used. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -111,6 +111,12 @@ public class HoodieWriteConfig extends DefaultHoodieConfig {\n public static final String DEFAULT_EMBEDDED_TIMELINE_SERVER_ENABLED = \"true\";\n public static final String EMBEDDED_TIMELINE_SERVER_PORT = \"hoodie.embed.timeline.server.port\";\n public static final String DEFAULT_EMBEDDED_TIMELINE_SERVER_PORT = \"0\";\n+ public static final String EMBEDDED_TIMELINE_SERVER_THREADS = \"hoodie.embed.timeline.server.threads\";\n+ public static final String DEFAULT_EMBEDDED_TIMELINE_SERVER_THREADS = \"-1\";\n+ public static final String EMBEDDED_TIMELINE_SERVER_COMPRESS_OUTPUT = \"hoodie.embed.timeline.server.gzip\";\n+ public static final String DEFAULT_EMBEDDED_TIMELINE_COMPRESS_OUTPUT = \"true\";\n+ public static final String EMBEDDED_TIMELINE_SERVER_USE_ASYNC = \"hoodie.embed.timeline.server.async\";\n+ public static final String DEFAULT_EMBEDDED_TIMELINE_SERVER_ASYNC = \"false\";\n \n public static final String FAIL_ON_TIMELINE_ARCHIVING_ENABLED_PROP = \"hoodie.fail.on.timeline.archiving\";\n public static final String DEFAULT_FAIL_ON_TIMELINE_ARCHIVING_ENABLED = \"true\";\n\nCallgraph: \t[HoodieWriteConfig->[Builder->[build->[HoodieWriteConfig,validate,setDefaults]],isClusteringEnabled->[isInlineClustering,isAsyncClusteringEnabled],getFileListingParallelism->[getFileListingParallelism],resetViewStorageConfig->[setViewStorageConfig],shouldAssumeDatePartitioning->[shouldAssumeDatePartitioning],useFileListingMetadata->[useFileListingMetadata]]]\nCodereview: ", "role": "user" }, { "content": "I have faced the same issue with jetty before. we can just turn this to `true` by default. changes seem safe enough. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -92,8 +92,10 @@ public class Constant {\n public static final String NODE_P2P_VERSION = \"node.p2p.version\";\n public static final String NODE_RPC_PORT = \"node.rpc.port\";\n public static final String NODE_RPC_SOLIDITY_PORT = \"node.rpc.solidityPort\";\n+ public static final String NODE_RPC_PBFT_PORT = \"node.rpc.PBFTPort\";\n public static final String NODE_HTTP_FULLNODE_PORT = \"node.http.fullNodePort\";\n public static final String NODE_HTTP_SOLIDITY_PORT = \"node.http.solidityPort\";\n+ public static final String NODE_HTTP_PBFT_PORT = \"node.http.PBFTPort\";\n \n public static final String NODE_RPC_THREAD = \"node.rpc.thread\";\n public static final String NODE_SOLIDITY_THREADS = \"node.solidity.threads\";\n\nCallgraph: \t[Constant->[fromString]]\nCodereview: ", "role": "user" }, { "content": "Be consistent with other configuration items. Since you have node.max**Http**ConnectNumber already, `node.http.PbftPort` is preferred. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -94,6 +94,11 @@ public class HoodieWriteConfig extends DefaultHoodieConfig {\n public static final String BULKINSERT_SORT_MODE = \"hoodie.bulkinsert.sort.mode\";\n public static final String DEFAULT_BULKINSERT_SORT_MODE = BulkInsertSortMode.GLOBAL_SORT\n .toString();\n+ public static final String DELETE_MARKER_FIELD_PROP = \"hoodie.write.delete.marker.field\";\n+ public static final String DEFAULT_DELETE_MARKER_FIELD = \"_hoodie_is_deleted\";\n+\n+ public static final String UPDATE_PARTIAL_FIELDS = \"hoodie.update.partial.fields\";\n+ public static final String DEFAULT_UPDATE_PARTIAL_FIELDS = \"false\";\n \n public static final String EMBEDDED_TIMELINE_SERVER_ENABLED = \"hoodie.embed.timeline.server\";\n public static final String DEFAULT_EMBEDDED_TIMELINE_SERVER_ENABLED = \"true\";\n\nCallgraph: \t[HoodieWriteConfig->[resetViewStorageConfig->[setViewStorageConfig],Builder->[build->[HoodieWriteConfig,validate,setDefaults]]]]\nCodereview: ", "role": "user" }, { "content": "Is this needed for this change? what is this used for? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -148,6 +148,10 @@ public final class Const {\n public static final String PATH_CHECKSESSION = \"checksession\";\n \n public static final String URL_PREFIX = \"urlPrefix\";\n- \n+\n public static final String INSTANCE_PUBKEY_PRO = \"publickey\";\n+\n+ public static final String GROUPID = \"io.servicecomb\";\n+\n+ public static final String ARTIFACTID = \"java-chassis\";\n }\nCallgraph: \t[Const->[REGISTRY_API->[getRegistryApiVersion,format,equals,getDomainName]]]\nCodereview: ", "role": "user" } ]
d6877a096949d92e
{ "callgraph": "[Start->[Start,Lock,Wait,Debug,Info,Submit,Combine,Unlock,SetRouter],Register->[Type,ApplyUnaryInbound,Unary,Info,NewUnaryHandlerSpec,ApplyOnewayInbound,Oneway,Sprintf,Register,NewOnewayHandlerSpec,Object],Stop->[Debug,Wait,Info,Submit,Combine],ClientConfig->[MultiOutbound],With,UnaryChain,ApplyUnaryOutbound,NewNopContextExtractor,Named,Transports,ValidateServiceName,Error,Sprintf,NewUnary,NewNop,ApplyRouteTable,ApplyOnewayOutbound,String,Namespace]", "msg": "To minimize the possibility of regret, perhaps we name this `ZapLogger`.", "patch": "@@ -72,9 +72,7 @@ type Config struct {\n \n \t// Logger provides a logger for the dispatcher. The default logger is a\n \t// no-op.\n-\t// TODO(shah): Export this when we're ready to deploy a branch in\n-\t// demo-yarpc-go.\n-\tlogger *zap.Logger\n+\tLogger *zap.Logger\n }\n \n // Inbounds contains a list of inbound transports. Each inbound transport", "summary": "Examples of how to configure a new Dispatcher. Easy way to re - enable the EWYY mode." }
[ { "content": "Please Give FORMAL Codereview for software developers in one sentence from the given diff hunk. Don’t start with Codereview/review. Just give the answer. Five examples are given before with code and code review and the code to work on is given after.", "role": "user" }, { "content": "Code: \t@@ -975,6 +975,8 @@ type Worker struct {\n \tLabels map[string]string\n \t// Taints is a list of taints for all the `Node` objects in this worker pool.\n \tTaints []corev1.Taint\n+\t// Kubelet contains configuration settings for the kubelet.\n+\tKubelet *KubeletConfig\n }\n \n // Extension contains type and provider information for Shoot extensions.\n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "Can you please create a section `Kubernetes` and move the `kubeProxy` settings to it as well (kube-proxy and kubelet are both worker pool specific). </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -111,6 +111,13 @@ type DeploymentConfig struct {\n \t// The reasons for the update to this deployment config.\n \t// This could be based on a change made by the user or caused by an automatic trigger\n \tDetails *DeploymentDetails `json:\"details,omitempty\" yaml:\"details,omitempty\"`\n+\t// Rollback indicates that this is a special deployment config intended to move\n+\t// from an existing deployment state to another previously defined state\n+\tRollback *RollbackConfig `json:\"rollback,omitempty\" yaml:\"rollback,omitempty\"`\n+}\n+\n+type RollbackConfig struct {\n+\tTo string\n }\n \n // DeploymentTemplate contains all the necessary information to create a Deployment from a\n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "Why can't this be part of details? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -66,11 +66,14 @@ type MeshCataloger interface {\n \t// ListTrafficPolicies returns all the traffic policies for a given service that Envoy proxy should be aware of.\n \tListTrafficPolicies(service.MeshService) ([]trafficpolicy.TrafficTarget, error)\n \n-\t// ListTrafficPoliciesForServiceAccount returns all inbound and outbound traffic policies related to the given service account\n-\tListTrafficPoliciesForServiceAccount(service.K8sServiceAccount) ([]*trafficpolicy.InboundTrafficPolicy, []*trafficpolicy.OutboundTrafficPolicy, error)\n+\t// ListTrafficPoliciesForServiceAccount returns all inbound traffic policies related to the given service account and inbound services\n+\tListInboundTrafficPolicies(service.K8sServiceAccount, []service.MeshService) []*trafficpolicy.InboundTrafficPolicy\n+\n+\t// ListTrafficPoliciesForServiceAccount returns all outbound traffic policies related to the given service account\n+\tListOutboundTrafficPolicies(service.K8sServiceAccount) []*trafficpolicy.OutboundTrafficPolicy\n \n \t// ListPoliciesForPermissiveMode returns all inbound and outbound traffic policies related to the given services\n-\tListPoliciesForPermissiveMode(services []service.MeshService) ([]*trafficpolicy.InboundTrafficPolicy, []*trafficpolicy.OutboundTrafficPolicy, error)\n+\tListPoliciesForPermissiveMode(services []service.MeshService) ([]*trafficpolicy.InboundTrafficPolicy, []*trafficpolicy.OutboundTrafficPolicy)\n \n \t// ListAllowedInboundServices lists the inbound services allowed to connect to the given service.\n \tListAllowedInboundServices(service.MeshService) ([]service.MeshService, error)\n\nCallgraph: \t[New]\nCodereview: ", "role": "user" }, { "content": "Please open an issue to not have a separate API for permissive mode, and rather handle it internally in the catalog. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -414,6 +414,9 @@ type ClusterAutoscaler struct {\n \t// MaxGracefulTerminationSeconds is the number of seconds CA waits for pod termination when trying to scale down a node (default: 600).\n \t// +optional\n \tMaxGracefulTerminationSeconds *int32 `json:\"maxGracefulTerminationSeconds,omitempty\" protobuf:\"varint,9,opt,name=maxGracefulTerminationSeconds\"`\n+\t// IgnoreTaints specifies a list of taint keys to ignore in node templates when considering to scale a node group.\n+\t// +optional\n+\tIgnoreTaints []string `json:\"ignoreTaints,omitempty\" protobuf:\"bytes,10,opt,name=ignoreTaints\"`\n }\n \n // ExpanderMode is type used for Expander values\n\nCallgraph: \t[FromInt]\nCodereview: ", "role": "user" }, { "content": "Does it make sense to add some validation for this field? For example preventing that duplicate keys can be specified? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -92,6 +92,9 @@ type StartUpdateResponse struct {\n \n \t// Token is the lease token (if any) to be used to authorize operations on this update.\n \tToken string `json:\"token,omitempty\"`\n+\n+\t// RequiredPolicies is a list of required Policy Packs to run.\n+\tRequiredPolicies []RequiredPolicy `json:\"requiredPolicies,omitempty\"`\n }\n \n // UpdateEventKind is an enum for the type of update events.\n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "\"... during the update.\" Question: Is there any proof/guarantee provided by the CLI that the policy pack is actually ran? Or is it really just on the honor system? (And a malicious client could actually not run the required policy packs?) </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -72,9 +72,7 @@ type Config struct {\n \n \t// Logger provides a logger for the dispatcher. The default logger is a\n \t// no-op.\n-\t// TODO(shah): Export this when we're ready to deploy a branch in\n-\t// demo-yarpc-go.\n-\tlogger *zap.Logger\n+\tLogger *zap.Logger\n }\n \n // Inbounds contains a list of inbound transports. Each inbound transport\nCallgraph: \t[Start->[Start,Lock,Wait,Debug,Info,Submit,Combine,Unlock,SetRouter],Register->[Type,ApplyUnaryInbound,Unary,Info,NewUnaryHandlerSpec,ApplyOnewayInbound,Oneway,Sprintf,Register,NewOnewayHandlerSpec,Object],Stop->[Debug,Wait,Info,Submit,Combine],ClientConfig->[MultiOutbound],With,UnaryChain,ApplyUnaryOutbound,NewNopContextExtractor,Named,Transports,ValidateServiceName,Error,Sprintf,NewUnary,NewNop,ApplyRouteTable,ApplyOnewayOutbound,String,Namespace]\nCodereview: ", "role": "user" } ]
cd49283116e9b05a
{ "callgraph": "[PlansController->[rollup->[new],destroy->[destroy],create->[new],new->[new],visibility->[visibility],status->[status],get_most_recent->[new]]]", "msg": "Since the IdentifierScheme's don't change without us making additional code changes, perhaps this should be added as a constant as we previously did with Perms?", "patch": "@@ -38,9 +38,13 @@ class PlansController < ApplicationController\n def create\n @plan = Plan.new\n authorize @plan\n-\n+ \n @plan.principal_investigator = current_user.surname.blank? ? nil : \"#{current_user.firstname} #{current_user.surname}\"\n- @plan.data_contact = current_user.email\n+ @plan.principal_investigator_email = current_user.email\n+ \n+ orcid = current_user.identifier_for(IdentifierScheme.find_by(name: 'orcid'))\n+ @plan.principal_investigator_identifier = orcid.identifier unless orcid.nil?\n+ \n @plan.funder_name = plan_params[:funder_name]\n \n @plan.visibility = (plan_params['visibility'].blank? ? Rails.application.config.default_plan_visibility :", "summary": "Creates a new n - word word grammar for the given user. This method is called when the user has used a custom version of the template." }
[ { "content": "Please Give FORMAL Codereview for software developers in one sentence from the given diff hunk. Don’t start with Codereview/review. Just give the answer. Five examples are given before with code and code review and the code to work on is given after.", "role": "user" }, { "content": "Code: \t@@ -73,9 +73,8 @@ class ArticlesController < ApplicationController\n \n def edit\n authorize @article\n- @user = @article.user\n+ @organization = @article.user&.organization\n @version = @article.has_frontmatter? ? \"v1\" : \"v2\"\n- @organization = @user&.organization\n end\n \n def manage\n\nCallgraph: \t[ArticlesController->[preview->[new],new->[new],update->[update]]]\nCodereview: ", "role": "user" }, { "content": "the `@user` object is never used in the `edit` view, hence we only ask for the `organization` </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -88,14 +88,16 @@ class ArticlesController < ApplicationController\n \n def edit\n authorize @article\n+\n @version = @article.has_frontmatter? ? \"v1\" : \"v2\"\n @user = @article.user\n @organizations = @user&.organizations\n end\n \n def manage\n- @article = @article.decorate\n authorize @article\n+\n+ @article = @article.decorate\n @user = @article.user\n @rating_vote = RatingVote.where(article_id: @article.id, user_id: @user.id).first\n @buffer_updates = BufferUpdate.where(composer_user_id: @user.id, article_id: @article.id)\n\nCallgraph: \t[ArticlesController->[preview->[new],new->[new],update->[update]]]\nCodereview: ", "role": "user" }, { "content": "Why did you move this line below line 98 rather than leaving it above it on line 97? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -103,7 +103,9 @@ class Game < Base\n \n def to_h(include_actions: false, player: nil)\n actions_h = include_actions ? actions.map(&:to_h) : []\n- settings_h = include_actions ? settings.to_h : {}\n+ settings_h = settings.to_h\n+\n+ settings_h.delete('seed') unless include_actions\n \n # Move user settings and hide from other players\n user_settings_h = settings_h.dig('players', player)\n\nCallgraph: \t[Game->[home_games->[transform_values,id,to_i,reverse],to_h->[to_h,dig,to_a,map,delete],update_player_settings->[filter,merge,include?],ordered_players->[shuffle,new],many_to_one,freeze,many_to_many,one_to_many],require_relative]\nCodereview: ", "role": "user" }, { "content": "why do we delete seed? just keep it in. once you make this change go ahead and merge </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -159,8 +159,8 @@ class EpisodeRecord < ApplicationRecord\n \n def twitter_share_body\n work_title = work.local_title\n- title = self.comment.present? ? work_title.truncate(30) : work_title\n- comment = self.comment.present? ? \"#{self.comment} / \" : \"\"\n+ title = self.body.present? ? work_title.truncate(30) : work_title\n+ comment = self.body.present? ? \"#{self.body} / \" : \"\"\n episode_number = episode.local_number\n share_url = share_url_with_query(:twitter)\n share_hashtag = work.hashtag_with_hash\n\nCallgraph: \t[EpisodeRecord->[update_share_record_status->[share_record_to_twitter?,update_column,shared_twitter?],share_to_sns->[perform_later,shared_twitter?],twitter_share_body->[hashtag_with_hash,local_title,sub,local_number,share_url_with_query,present?,length,truncate,comment,locale],rating_state_order->[order,upcase,in?],facebook_share_body->[present?,comment,locale],setup_shared_sns->[shared_twitter,present?,authorized_to?,share_record_to_twitter?],generate_url_hash->[slice],shared_sns?->[present?,shared_twitter?],work->[work],share_url->[username,id,preferred_annict_url],initial->[first],facebook_share_title->[title,title_with_number],initial?->[id],transitions,aasm,between?,include,state,belongs_to,write_attribute,scope,validates,extend,event,enumerize,where,has_many,not]]\nCodereview: ", "role": "user" }, { "content": "Style/RedundantSelf: Redundant self detected. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -159,8 +159,8 @@ class EpisodeRecord < ApplicationRecord\n \n def twitter_share_body\n work_title = work.local_title\n- title = self.comment.present? ? work_title.truncate(30) : work_title\n- comment = self.comment.present? ? \"#{self.comment} / \" : \"\"\n+ title = self.body.present? ? work_title.truncate(30) : work_title\n+ comment = self.body.present? ? \"#{self.body} / \" : \"\"\n episode_number = episode.local_number\n share_url = share_url_with_query(:twitter)\n share_hashtag = work.hashtag_with_hash\n\nCallgraph: \t[EpisodeRecord->[update_share_record_status->[share_record_to_twitter?,update_column,shared_twitter?],share_to_sns->[perform_later,shared_twitter?],twitter_share_body->[hashtag_with_hash,local_title,sub,local_number,share_url_with_query,present?,length,truncate,comment,locale],rating_state_order->[order,upcase,in?],facebook_share_body->[present?,comment,locale],setup_shared_sns->[shared_twitter,present?,authorized_to?,share_record_to_twitter?],generate_url_hash->[slice],shared_sns?->[present?,shared_twitter?],work->[work],share_url->[username,id,preferred_annict_url],initial->[first],facebook_share_title->[title,title_with_number],initial?->[id],transitions,aasm,between?,include,state,belongs_to,write_attribute,scope,validates,extend,event,enumerize,where,has_many,not]]\nCodereview: ", "role": "user" }, { "content": "Style/RedundantSelf: Redundant self detected. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -38,9 +38,13 @@ class PlansController < ApplicationController\n def create\n @plan = Plan.new\n authorize @plan\n-\n+ \n @plan.principal_investigator = current_user.surname.blank? ? nil : \"#{current_user.firstname} #{current_user.surname}\"\n- @plan.data_contact = current_user.email\n+ @plan.principal_investigator_email = current_user.email\n+ \n+ orcid = current_user.identifier_for(IdentifierScheme.find_by(name: 'orcid'))\n+ @plan.principal_investigator_identifier = orcid.identifier unless orcid.nil?\n+ \n @plan.funder_name = plan_params[:funder_name]\n \n @plan.visibility = (plan_params['visibility'].blank? ? Rails.application.config.default_plan_visibility :\nCallgraph: \t[PlansController->[rollup->[new],destroy->[destroy],create->[new],new->[new],visibility->[visibility],status->[status],get_most_recent->[new]]]\nCodereview: ", "role": "user" } ]
f60d879bbc59089b
{ "callgraph": "[CommandDispatcher->[move_to_next_line->[_current_widget],view_source->[show_source_cb->[_current_url],_current_widget],search_prev->[_current_widget,search],back->[_back_forward],move_to_prev_line->[_current_widget],_parse_url_input->[_parse_url],paste->[_open],scroll_perc->[_current_widget],move_to_next_word->[_current_widget],quickmark_del->[_current_url],open_editor->[_current_widget],drop_selection->[_current_widget],fake_key->[_current_widget],download->[_current_widget,_current_url],move_to_end_of_line->[_current_widget],zoom->[_current_widget],_cntwidget->[_count],debug_clear_ssl_errors->[_current_widget],move_to_end_of_document->[_current_widget],navigate->[_current_widget,_open,_current_url],zoom_in->[_current_widget],scroll_px->[_current_widget],move_to_end_of_next_block->[_current_widget],jump_mark->[jump_mark],stop->[_cntwidget,stop],search_next->[_current_widget,search],click_element->[_current_widget],jseval->[_current_widget],bookmark_del->[_current_url],move_to_next_char->[_current_widget],_yank_url->[_current_url],insert_text->[_insert_text_cb->[insert_text],_current_widget],move_to_end_of_prev_block->[_current_widget],tab_close->[_cntwidget,_get_selection_override],move_to_end_of_word->[_current_widget],bookmark_add->[_current_url,_current_title],show_help->[_open],move_to_prev_word->[_current_widget],move_to_start_of_next_block->[_current_widget],edit_url->[_current_url],home->[openurl],move_to_start_of_prev_block->[_current_widget],tab_move->[_current_widget,_current_index,_set_current_index,_count],openurl->[openurl,_cntwidget,_open],debug_webaction->[_current_widget],_tab_focus_last->[_set_current_index],toggle_inspector->[_current_widget],tab_next->[_current_index,_set_current_index,_count],move_to_start_of_document->[_current_widget],quickmark_load->[_open],zoom_out->[_current_widget],scroll_page->[_current_widget,navigate],move_to_start_of_line->[_current_widget],tab_detach->[_current_url,_open,_current_widget,_count],tab_focus->[_set_current_index,_count,tab_next,_tab_focus_last],bookmark_load->[_open],follow_selected->[_current_widget],quickmark_save->[_current_url],_open_if_changed->[openurl],reloadpage->[_cntwidget],set_mark->[set_mark],_back_forward->[_current_widget,tab_clone],_run_userscript->[_current_index],_download_mhtml->[_current_widget,_current_title],scroll->[_current_widget],tab_clone->[_current_widget,_current_index,_new_tabbed_browser],_open->[_new_tabbed_browser,_current_widget],printpage->[_cntwidget],forward->[_back_forward],debug_dump_page->[_current_widget],undo->[undo],messages->[_open],search->[_current_widget,search],yank->[_current_url,_current_index,_yank_url,_current_widget],move_to_prev_char->[_current_widget],tab_prev->[_current_index,_set_current_index,_count],toggle_selection->[_current_widget]]]", "msg": "You can most likely remove that (and the try/finally) too, as we shouldn't have any flickering from removing/inserting tabs anymore now.", "patch": "@@ -1028,17 +1028,13 @@ class CommandDispatcher:\n raise cmdexc.CommandError(\"Can't move tab to position {}!\".format(\n new_idx + 1))\n \n- tab = self._current_widget()\n cur_idx = self._current_index()\n- icon = self._tabbed_browser.tabIcon(cur_idx)\n- label = self._tabbed_browser.page_title(cur_idx)\n cmdutils.check_overflow(cur_idx, 'int')\n cmdutils.check_overflow(new_idx, 'int')\n self._tabbed_browser.setUpdatesEnabled(False)\n try:\n color = self._tabbed_browser.tab_indicator_color(cur_idx)\n- self._tabbed_browser.removeTab(cur_idx)\n- self._tabbed_browser.insertTab(new_idx, tab, icon, label)\n+ self._tabbed_browser.tabBar().moveTab(cur_idx, new_idx)\n self._set_current_index(new_idx)\n self._tabbed_browser.set_tab_indicator_color(new_idx, color)\n finally:", "summary": "Move the current tab according to the argument and [ count. Set current tab indicator color and update tabbed browser." }
[ { "content": "Please Give FORMAL Codereview for software developers in one sentence from the given diff hunk. Don’t start with Codereview/review. Just give the answer. Five examples are given before with code and code review and the code to work on is given after.", "role": "user" }, { "content": "Code: \t@@ -222,7 +222,7 @@ namespace Dynamo.Controls\n // creates a new tab item\n tab = new TabItem();\n tab.Header = viewExtension.Name;\n- tab.Tag = viewExtension.GetType();\n+ tab.Tag = viewExtension;\n tab.Uid = viewExtension.UniqueId;\n tab.HeaderTemplate = tabDynamic.FindResource(\"TabHeader\") as DataTemplate;\n \n\nCallgraph: \t[DynamoView->[CloseExtensionTab->[CloseExtensionTab],DynamoView_Unloaded->[UnsubscribeNodeViewCustomizationEvents],LibraryHandle_MouseLeave->[UpdateLibraryCollapseIcon],DynamoViewModelRequestShowPackageManagerSearch->[DisplayTermsOfUseForAcceptance],Log->[Log],ExtensionHandle_MouseLeave->[UpdateHandleUnhoveredStyle],WindowClosing->[PerformShutdownSequenceOnViewModel],OnCollapsedLeftSidebarClick->[UpdateLibraryCollapseIcon],WindowClosed->[PerformShutdownSequenceOnViewModel],ToggleExtensionBarCollapseStatus->[UpdateLibraryCollapseIcon],WorkspaceTabs_TargetUpdated->[ToggleWorkspaceTabVisibility],WorkspaceTabs_SizeChanged->[ToggleWorkspaceTabVisibility,UpdateLibraryCollapseIcon],Window_PreviewMouseLeftButtonUp->[HidePopupWhenWindowDeactivated],DynamoView_Loaded->[DynamoLoadedViewExtensionHandler,LoadNodeViewCustomizations,SubscribeNodeViewCustomizationEvents,InitializeLogin,InitializeStartPage,InitializeShortcutBar],ExtensionHandle_MouseEnter->[UpdateHandleHoveredStyle],Dispose->[OnCollectionChanged,Dispose],SlideWindowToIncludeTab->[GetSlidingWindowSize]]]\nCodereview: ", "role": "user" }, { "content": "Can we consider if this causes any memory leak issues? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -227,6 +227,7 @@ namespace Dynamo.Controls\n TabItem tab = new TabItem();\n tab.Header = viewExtension.Name;\n tab.Tag = viewExtension.GetType();\n+ tab.Uid = viewExtension.UniqueId;\n tab.HeaderTemplate = tabDynamic.FindResource(\"TabHeader\") as DataTemplate;\n \n // setting the extension UI to the current tab content \n\nCallgraph: \t[DynamoView->[DynamoView_Unloaded->[UnsubscribeNodeViewCustomizationEvents],CloseTab->[CloseTab],OnCollapsedRightSidebarClick->[updateCollapseIcon],DynamoViewModelRequestShowPackageManagerSearch->[DisplayTermsOfUseForAcceptance],Log->[Log],WindowClosing->[PerformShutdownSequenceOnViewModel],OnCollapsedLeftSidebarClick->[updateCollapseIcon],WindowClosed->[PerformShutdownSequenceOnViewModel],Button_MouseLeave->[updateCollapseIcon],WorkspaceTabs_TargetUpdated->[ToggleWorkspaceTabVisibility],WorkspaceTabs_SizeChanged->[ToggleWorkspaceTabVisibility,updateCollapseIcon],Window_PreviewMouseLeftButtonUp->[HidePopupWhenWindowDeactivated],DynamoView_Loaded->[DynamoLoadedViewExtensionHandler,LoadNodeViewCustomizations,SubscribeNodeViewCustomizationEvents,InitializeLogin,InitializeStartPage,InitializeShortcutBar],Dispose->[OnCollectionChanged,Dispose,Log],SlideWindowToIncludeTab->[GetSlidingWindowSize]]]\nCodereview: ", "role": "user" }, { "content": "are we going to stick to name or use this? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -29,16 +29,13 @@ class E2EELabel extends Component<Props> {\n return null;\n }\n \n- // eslint-disable-next-line react/jsx-max-props-per-line\n- const icon = <Icon size = { 22 } src = { IconE2EE } />;\n-\n return (\n <Tooltip\n content = { this.props.t('e2ee.labelToolTip') }\n position = { 'left' }>\n <CircularLabel\n className = 'e2ee'\n- label = { icon } />\n+ icon = { IconE2EE } />\n </Tooltip>\n );\n }\n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "how about the size now? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -215,8 +215,16 @@ namespace Dynamo.Controls\n tab.Tag = viewExtension.GetType();\n tab.HeaderTemplate = tabDynamic.FindResource(\"TabHeader\") as DataTemplate;\n \n- // setting the extension window to the current tab content\n- tab.Content = contentControl.Content;\n+ // setting the extension UI to the current tab content \n+ // based on whether it is a UserControl element or window element. \n+ if (contentControl.Template.TargetType.Name.Equals(new UserControl().GetType().Name))\n+ {\n+ tab.Content = contentControl;\n+ }\n+ else\n+ {\n+ tab.Content = contentControl.Content;\n+ }\n \n //Insert the tab at the end\n TabItems.Insert(count, tab);\n\nCallgraph: \t[DynamoView->[DynamoView_Unloaded->[UnsubscribeNodeViewCustomizationEvents],OnCollapsedRightSidebarClick->[updateCollapseIcon],DynamoViewModelRequestShowPackageManagerSearch->[DisplayTermsOfUseForAcceptance],Log->[Log],WindowClosing->[PerformShutdownSequenceOnViewModel],OnCollapsedLeftSidebarClick->[updateCollapseIcon],WindowClosed->[PerformShutdownSequenceOnViewModel],Button_MouseLeave->[updateCollapseIcon],WorkspaceTabs_TargetUpdated->[ToggleWorkspaceTabVisibility],WorkspaceTabs_SizeChanged->[ToggleWorkspaceTabVisibility,updateCollapseIcon],Window_PreviewMouseLeftButtonUp->[HidePopupWhenWindowDeactivated],DynamoView_Loaded->[DynamoLoadedViewExtensionHandler,LoadNodeViewCustomizations,SubscribeNodeViewCustomizationEvents,InitializeLogin,InitializeStartPage,InitializeShortcutBar],Dispose->[OnCollectionChanged,Dispose,Log],SlideWindowToIncludeTab->[GetSlidingWindowSize]]]\nCodereview: ", "role": "user" }, { "content": "`if (contentControl is UserControl)`, you can compare type directly? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -701,7 +701,12 @@ define([\n var color = queryColorValue(node, 'color', namespaces.kml);\n \n var iconNode = queryFirstNode(node, 'Icon', namespaces.kml);\n- var icon = getIconHref(iconNode, dataSource, sourceUri, uriResolver, false, query);\n+ var icon;\n+ if (!defined(iconNode)) {\n+ icon = dataSource._pinBuilder.fromColor(Color.YELLOW, 64);\n+ } else {\n+ icon = getIconHref(iconNode, dataSource, sourceUri, uriResolver, false, query);\n+ }\n var x = queryNumericValue(iconNode, 'x', namespaces.gx);\n var y = queryNumericValue(iconNode, 'y', namespaces.gx);\n var w = queryNumericValue(iconNode, 'w', namespaces.gx);\n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "What situation does this address that isn't addressed below? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -1028,17 +1028,13 @@ class CommandDispatcher:\n raise cmdexc.CommandError(\"Can't move tab to position {}!\".format(\n new_idx + 1))\n \n- tab = self._current_widget()\n cur_idx = self._current_index()\n- icon = self._tabbed_browser.tabIcon(cur_idx)\n- label = self._tabbed_browser.page_title(cur_idx)\n cmdutils.check_overflow(cur_idx, 'int')\n cmdutils.check_overflow(new_idx, 'int')\n self._tabbed_browser.setUpdatesEnabled(False)\n try:\n color = self._tabbed_browser.tab_indicator_color(cur_idx)\n- self._tabbed_browser.removeTab(cur_idx)\n- self._tabbed_browser.insertTab(new_idx, tab, icon, label)\n+ self._tabbed_browser.tabBar().moveTab(cur_idx, new_idx)\n self._set_current_index(new_idx)\n self._tabbed_browser.set_tab_indicator_color(new_idx, color)\n finally:\nCallgraph: \t[CommandDispatcher->[move_to_next_line->[_current_widget],view_source->[show_source_cb->[_current_url],_current_widget],search_prev->[_current_widget,search],back->[_back_forward],move_to_prev_line->[_current_widget],_parse_url_input->[_parse_url],paste->[_open],scroll_perc->[_current_widget],move_to_next_word->[_current_widget],quickmark_del->[_current_url],open_editor->[_current_widget],drop_selection->[_current_widget],fake_key->[_current_widget],download->[_current_widget,_current_url],move_to_end_of_line->[_current_widget],zoom->[_current_widget],_cntwidget->[_count],debug_clear_ssl_errors->[_current_widget],move_to_end_of_document->[_current_widget],navigate->[_current_widget,_open,_current_url],zoom_in->[_current_widget],scroll_px->[_current_widget],move_to_end_of_next_block->[_current_widget],jump_mark->[jump_mark],stop->[_cntwidget,stop],search_next->[_current_widget,search],click_element->[_current_widget],jseval->[_current_widget],bookmark_del->[_current_url],move_to_next_char->[_current_widget],_yank_url->[_current_url],insert_text->[_insert_text_cb->[insert_text],_current_widget],move_to_end_of_prev_block->[_current_widget],tab_close->[_cntwidget,_get_selection_override],move_to_end_of_word->[_current_widget],bookmark_add->[_current_url,_current_title],show_help->[_open],move_to_prev_word->[_current_widget],move_to_start_of_next_block->[_current_widget],edit_url->[_current_url],home->[openurl],move_to_start_of_prev_block->[_current_widget],tab_move->[_current_widget,_current_index,_set_current_index,_count],openurl->[openurl,_cntwidget,_open],debug_webaction->[_current_widget],_tab_focus_last->[_set_current_index],toggle_inspector->[_current_widget],tab_next->[_current_index,_set_current_index,_count],move_to_start_of_document->[_current_widget],quickmark_load->[_open],zoom_out->[_current_widget],scroll_page->[_current_widget,navigate],move_to_start_of_line->[_current_widget],tab_detach->[_current_url,_open,_current_widget,_count],tab_focus->[_set_current_index,_count,tab_next,_tab_focus_last],bookmark_load->[_open],follow_selected->[_current_widget],quickmark_save->[_current_url],_open_if_changed->[openurl],reloadpage->[_cntwidget],set_mark->[set_mark],_back_forward->[_current_widget,tab_clone],_run_userscript->[_current_index],_download_mhtml->[_current_widget,_current_title],scroll->[_current_widget],tab_clone->[_current_widget,_current_index,_new_tabbed_browser],_open->[_new_tabbed_browser,_current_widget],printpage->[_cntwidget],forward->[_back_forward],debug_dump_page->[_current_widget],undo->[undo],messages->[_open],search->[_current_widget,search],yank->[_current_url,_current_index,_yank_url,_current_widget],move_to_prev_char->[_current_widget],tab_prev->[_current_index,_set_current_index,_count],toggle_selection->[_current_widget]]]\nCodereview: ", "role": "user" } ]
5adca273356e738b
{ "callgraph": "[StringConfigurationSource->[GetDouble->[GetString],GetInt32->[GetString],GetBool->[GetString],GetDictionary->[ParseCustomKeyValues,GetString]]]", "msg": "I looks like we can make `allowOptionalMappings` non-optional since we have another overload without it. (I thought this generated a compiler warning, but maybe it's just R#)", "patch": "@@ -17,6 +17,18 @@ namespace Datadog.Trace.Configuration\n /// <param name=\"data\">A string containing key-value pairs which are comma-separated, and for which the key and value are colon-separated.</param>\n /// <returns><see cref=\"IDictionary{TKey, TValue}\"/> of key value pairs.</returns>\n public static IDictionary<string, string> ParseCustomKeyValues(string data)\n+ {\n+ return ParseCustomKeyValues(data, allowOptionalMappings: false);\n+ }\n+\n+ /// <summary>\n+ /// Returns a <see cref=\"IDictionary{TKey, TValue}\"/> from parsing\n+ /// <paramref name=\"data\"/>.\n+ /// </summary>\n+ /// <param name=\"data\">A string containing key-value pairs which are comma-separated, and for which the key and value are colon-separated.</param>\n+ /// <param name=\"allowOptionalMappings\">Determines whether to create dictionary entries when the input has no value mapping</param>\n+ /// <returns><see cref=\"IDictionary{TKey, TValue}\"/> of key value pairs.</returns>\n+ public static IDictionary<string, string> ParseCustomKeyValues(string data, bool allowOptionalMappings = false)\n {\n var dictionary = new ConcurrentDictionary<string, string>();\n ", "summary": "ParseCustomKeyValues - Parses a string into a dictionary of key - value pairs." }
[ { "content": "Please Give FORMAL Codereview for software developers in one sentence from the given diff hunk. Don’t start with Codereview/review. Just give the answer. Five examples are given before with code and code review and the code to work on is given after.", "role": "user" }, { "content": "Code: \t@@ -29,5 +29,15 @@ namespace System.Runtime.InteropServices\n /// </remarks>\n public static ref TValue GetValueRefOrNullRef<TKey, TValue>(Dictionary<TKey, TValue> dictionary, TKey key) where TKey : notnull\n => ref dictionary.FindValue(key);\n+\n+ /// <summary>\n+ /// Gets a ref to a <typeparamref name=\"TValue\"/> in the <see cref=\"Dictionary{TKey, TValue}\"/>, adding a new entry with a default value if it does not exist in the <paramref name=\"dictionary\"/>.\n+ /// </summary>\n+ /// <param name=\"dictionary\">The dictionary to get the ref to <typeparamref name=\"TValue\"/> from.</param>\n+ /// <param name=\"key\">The key used for lookup.</param>\n+ /// <param name=\"exists\">Whether or not a new entry for the given key was added to the dictionary.</param>\n+ /// <remarks>Items should not be added to or removed from the <see cref=\"Dictionary{TKey, TValue}\"/> while the ref <typeparamref name=\"TValue\"/> is in use.</remarks>\n+ public static ref TValue? GetValueRefOrAddDefault<TKey, TValue>(Dictionary<TKey, TValue> dictionary, TKey key, out bool exists) where TKey : notnull\n+ => ref Dictionary<TKey, TValue>.CollectionsMarshalHelper.GetValueRefOrAddDefault(dictionary, key, out exists);\n }\n }\n\nCallgraph: \t[CollectionsMarshal->[AsSpan->[_size,_items],GetValueRefOrNullRef->[FindValue]]]\nCodereview: ", "role": "user" }, { "content": "Grammar: should read \"added to or removed from\" </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -9,5 +9,10 @@ namespace NServiceBus.Faults\n /// Header key for setting/getting the queue at which the message processing failed.\n /// </summary>\n public const string FailedQ = \"NServiceBus.FailedQ\";\n+\n+ /// <summary>\n+ /// Header key for communicating <see cref=\"SecondLevelRetriesProcessor\"/> the value for <see cref=\"FailedQ\"/> header.\n+ /// </summary>\n+ public const string TemporatyFailedQueue = \"NServiceBus.TemporatyFailedQueue\";\n }\n }\n\\ No newline at end of file\n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "@SzymonPobiega - you have a typo in the queue name and the variable name :) </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -12,12 +12,12 @@\n /// <summary>\n /// \n /// </summary>\n- /// <param name=\"configuration\">The BusConfiguration instance.</param>\n+ /// <param name=\"configuration\">The EndpointConfiguration instance.</param>\n /// <param name=\"settings\">A string dictionary of settings from the RunDescriptor specifying Transport, Persistence,\n /// connection strings, Serializer, Builder, and other details. Transports must call configuration.UseTransport&lt;T&gt;().\n /// Persistence must call configuration.UsePersistence&lt;T&gt;(). </param>\n /// <returns>An async Task.</returns>\n- Task Configure(BusConfiguration configuration, IDictionary<string, string> settings);\n+ Task Configure(EndpointConfiguration configuration, IDictionary<string, string> settings);\n \n /// <summary>\n /// Gives the transport/persistence a chance to clean up after the test is complete. Implementors of this class may store\n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "nitpicking, but this could use a `<see cref=\"...\" />` ? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -17,14 +17,14 @@ namespace Microsoft.Extensions.Configuration\n /// <param name=\"key\">The key.</param>\n /// <param name=\"value\">The value.</param>\n /// <returns><c>True</c> if a value for the specified key was found, otherwise <c>false</c>.</returns>\n- bool TryGet(string key, out string value);\n+ bool TryGet(string key, [MaybeNullWhen(false)] out string value);\n \n /// <summary>\n /// Sets a configuration value for the specified key.\n /// </summary>\n /// <param name=\"key\">The key.</param>\n /// <param name=\"value\">The value.</param>\n- void Set(string key, string value);\n+ void Set(string key, string? value);\n \n /// <summary>\n /// Returns a change token if this provider supports change tracking, null otherwise.\n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "I think it would be more consistent (i.e. with dictionary) for this to be nullable with `NotNullWhen(true)` </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -20,11 +20,11 @@ namespace System.Text.Json.Nodes\n /// <returns>\n /// The new instance of the <see cref=\"JsonValue\"/> class that contains the specified value.\n /// </returns>\n- /// <typeparam name=\"T\">The type of value to be added.</typeparam>\n- /// <param name=\"value\">The value to add.</param>\n+ /// <typeparam name=\"T\">The type of value to create.</typeparam>\n+ /// <param name=\"value\">The value to create.</param>\n /// <param name=\"options\">Options to control the behavior.</param>\n /// <returns>The new instance of the <see cref=\"JsonValue\"/> class that contains the specified value.</returns>\n- public static JsonValue? Create<T>(T? value, JsonNodeOptions? options = null)\n+ public static JsonValue? Create<[DynamicallyAccessedMembers(JsonHelpers.MembersAccessedOnRead)]T>(T? value, JsonNodeOptions? options = null)\n {\n if (value == null)\n {\n\nCallgraph: \t[JsonValue->[Create->[Object,NodeElementCannotBeObjectOrArray,Null,ValueKind,Array],GetPath->[Assert,GetPath]]]\nCodereview: ", "role": "user" }, { "content": "I thought we were going to mark this as `RequiresUnreferencedCode`. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -17,6 +17,18 @@ namespace Datadog.Trace.Configuration\n /// <param name=\"data\">A string containing key-value pairs which are comma-separated, and for which the key and value are colon-separated.</param>\n /// <returns><see cref=\"IDictionary{TKey, TValue}\"/> of key value pairs.</returns>\n public static IDictionary<string, string> ParseCustomKeyValues(string data)\n+ {\n+ return ParseCustomKeyValues(data, allowOptionalMappings: false);\n+ }\n+\n+ /// <summary>\n+ /// Returns a <see cref=\"IDictionary{TKey, TValue}\"/> from parsing\n+ /// <paramref name=\"data\"/>.\n+ /// </summary>\n+ /// <param name=\"data\">A string containing key-value pairs which are comma-separated, and for which the key and value are colon-separated.</param>\n+ /// <param name=\"allowOptionalMappings\">Determines whether to create dictionary entries when the input has no value mapping</param>\n+ /// <returns><see cref=\"IDictionary{TKey, TValue}\"/> of key value pairs.</returns>\n+ public static IDictionary<string, string> ParseCustomKeyValues(string data, bool allowOptionalMappings = false)\n {\n var dictionary = new ConcurrentDictionary<string, string>();\n \nCallgraph: \t[StringConfigurationSource->[GetDouble->[GetString],GetInt32->[GetString],GetBool->[GetString],GetDictionary->[ParseCustomKeyValues,GetString]]]\nCodereview: ", "role": "user" } ]
7a9e0d491239446f
{ "callgraph": "[ConfigUtil->[installDynamicConfig->[createDynamicConfig],createDynamicConfig->[duplicateServiceCombConfigToCse,createConfigFromConfigCenter,createLocalConfig],getMicroserviceConfigLoader->[getProperty],convertEnvVariable->[getProperty],duplicateServiceCombConfigToCse->[duplicateServiceCombConfigToCse,getProperty],getProperty->[getProperty],createLocalConfig->[setMicroserviceConfigLoader,createLocalConfig]]]", "msg": "I think if we can provide a more convenient method to add configs . e.g. public static void addConfig(String k, Object v)", "patch": "@@ -52,9 +52,15 @@ public final class ConfigUtil {\n \n private static final String MICROSERVICE_CONFIG_LOADER_KEY = \"cse-microservice-config-loader\";\n \n+ private static ConfigModel model = new ConfigModel();\n+\n private ConfigUtil() {\n }\n \n+ public static void setConfigs(Map<String, Object> config) {\n+ model.setConfig(config);\n+ }\n+\n public static Object getProperty(String key) {\n Object config = DynamicPropertyFactory.getBackingConfigurationSource();\n return getProperty(config, key);", "summary": "Get a property from the configuration source." }
[ { "content": "Please Give FORMAL Codereview for software developers in one sentence from the given diff hunk. Don’t start with Codereview/review. Just give the answer. Five examples are given before with code and code review and the code to work on is given after.", "role": "user" }, { "content": "Code: \t@@ -38,14 +38,7 @@ import java.util.regex.Pattern;\n */\n public class MapBasedRow implements Row\n {\n- private static final Logger log = new Logger(MapBasedRow.class);\n- private static final Function<Object, String> TO_STRING_INCLUDING_NULL = new Function<Object, String>() {\n- @Override\n- public String apply(final Object o)\n- {\n- return String.valueOf(o);\n- }\n- };\n+ private static final Function<Object, String> TO_STRING_INCLUDING_NULL = o -> String.valueOf(o);\n \n private final DateTime timestamp;\n private final Map<String, Object> event;\n\nCallgraph: \t[MapBasedRow->[hashCode->[hashCode],compareTo->[getTimestamp,compareTo],equals->[equals]]]\nCodereview: ", "role": "user" }, { "content": "Could be method ref `String::valueOf` </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -90,11 +90,10 @@ public class PropertyUtil {\n }\n }\n \n-\n- private static String capitalizeFirstLetter(final String aString) {\n- char first = aString.charAt(0);\n+ private static String capitalizeFirstLetter(final String str) {\n+ char first = str.charAt(0);\n first = Character.toUpperCase(first);\n- return first + aString.substring(1);\n+ return first + str.substring(1);\n }\n \n private static Method getSetter(final String propertyName, final Object subject, final Object value) {\n\nCallgraph: \t[PropertyUtil->[getFieldIncludingFromSuperClasses->[getFieldIncludingFromSuperClasses],getResetter->[capitalizeFirstLetter],getSetter->[capitalizeFirstLetter],set->[set],getPropertyField->[getFieldIncludingFromSuperClasses]]]\nCodereview: ", "role": "user" }, { "content": "nit: prefer `str` to be spelled out, or renamed dto someting like `input`, but NBD </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -20,6 +20,10 @@ public class CredentialsMaskUtilTestCase\n private static final String URL_TEST = \"jdbc:sqlserver://1.1.1.1:1443;databaseName=STAGING;user=mulesoftuser;password=mulesoftpass;\";\n \n private static final String EXPECTED_URL_TEST_MASKED = \"jdbc:sqlserver://1.1.1.1:1443;databaseName=STAGING;user=<<user>>;password=<<credentials>>;\";\n+ \n+ private static final String URI_SPECIAL_CHARACTERS_AUTHORITY = \"sftp://user:Deloitte@alskdalaks@@hol@localhost:22/home/user/\";\n+\n+ private static final String EXPECTED_URI_MASKED = \"sftp://<<credentials>>@localhost:22/home/user/\";\n \n @Test\n public void whenUrlWithUserAndPasswordMaskUserPassword()\n\nCallgraph: \t[CredentialsMaskUtilTestCase->[whenUrlWithUserAndPasswordMaskUserPassword->[maskUrlUserAndPassword,equalTo,assertThat]]]\nCodereview: ", "role": "user" }, { "content": "is this a valid url? don't the `@` in the password have to be masked? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -87,7 +87,7 @@ public class ExplicitUnlockTest extends SingleCacheManagerTest {\n \n private static class Worker implements Callable<Boolean> {\n \n- private static String lockKey = \"0\"; // there is no cached Object with such key\n+ private static final String lockKey = \"0\"; // there is no cached Object with such key\n private final Cache<Object, Object> cache;\n private final boolean withUnlock;\n private final long stepDelayMsec;\n\nCallgraph: \t[ExplicitUnlockTest->[Worker->[unlock->[unlock],doRun->[log],validateCache->[log]],createCacheManager->[createCacheManager]]]\nCodereview: ", "role": "user" }, { "content": "IMO this should be in the Test class, because the Worker cannot guarantee that the key does not exist in the cache by itself. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -47,8 +47,13 @@ public class WebSocketServerHandler extends SimpleChannelInboundHandler<Object>\n \n private static final String WEBSOCKET_PATH = \"/websocket\";\n \n+ private final Set<ChannelHandler> httpHandlers;\n private WebSocketServerHandshaker handshaker;\n \n+ public WebSocketServerHandler(Set<ChannelHandler> httpHandlers) {\n+ this.httpHandlers = httpHandlers;\n+ }\n+\n @Override\n public void channelRead0(ChannelHandlerContext ctx, Object msg) {\n if (msg instanceof FullHttpRequest) {\n\nCallgraph: \t[WebSocketServerHandler->[handleWebSocketFrame->[write,PongWebSocketFrame,close,retain,channel],sendHttpResponse->[readableBytes,setContentLength,writeAndFlush,copiedBuffer,code,isKeepAlive,toString,release,writeBytes,addListener],channelRead0->[handleWebSocketFrame,handleHttpRequest],channelReadComplete->[flush],handleHttpRequest->[sendHttpResponse,channel,newHandshaker,handshake,getContent,equals,WebSocketServerHandshakerFactory,readableBytes,setContentLength,sendUnsupportedVersionResponse,getWebSocketLocation,DefaultFullHttpResponse,isSuccess,set,uri,method],getWebSocketLocation->[get],exceptionCaught->[printStackTrace,close]]]\nCodereview: ", "role": "user" }, { "content": "- Is this constructor supposed to be public? If not, let's make it package-local - This effectively removes the default constructor. Is this intended? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -52,9 +52,15 @@ public final class ConfigUtil {\n \n private static final String MICROSERVICE_CONFIG_LOADER_KEY = \"cse-microservice-config-loader\";\n \n+ private static ConfigModel model = new ConfigModel();\n+\n private ConfigUtil() {\n }\n \n+ public static void setConfigs(Map<String, Object> config) {\n+ model.setConfig(config);\n+ }\n+\n public static Object getProperty(String key) {\n Object config = DynamicPropertyFactory.getBackingConfigurationSource();\n return getProperty(config, key);\nCallgraph: \t[ConfigUtil->[installDynamicConfig->[createDynamicConfig],createDynamicConfig->[duplicateServiceCombConfigToCse,createConfigFromConfigCenter,createLocalConfig],getMicroserviceConfigLoader->[getProperty],convertEnvVariable->[getProperty],duplicateServiceCombConfigToCse->[duplicateServiceCombConfigToCse,getProperty],getProperty->[getProperty],createLocalConfig->[setMicroserviceConfigLoader,createLocalConfig]]]\nCodereview: ", "role": "user" } ]
9833722d3af985a8
{ "callgraph": "[createInfoStore,registerStore,addQueryArgs,dispatch,it,describe,createTestRegistry,select,unsubscribeFromAll,beforeEach,expect,afterEach]", "msg": "Minor detail, but let's use the interpolated template string syntax instead.", "patch": "@@ -30,6 +30,7 @@ import { STORE_NAME as CORE_SITE } from '../datastore/site/constants';\n import { STORE_NAME as CORE_USER } from '../datastore/user/constants';\n \n const MODULE_SLUG = 'test-slug';\n+const TEST_STORE_NAME = 'test/' + MODULE_SLUG;\n \n describe( 'createInfoStore store', () => {\n \tlet registry;", "summary": "Info datastore functions tests. requires that the main module is created." }
[ { "content": "Please Give FORMAL Codereview for software developers in one sentence from the given diff hunk. Don’t start with Codereview/review. Just give the answer. Five examples are given before with code and code review and the code to work on is given after.", "role": "user" }, { "content": "Code: \t@@ -1,6 +1,7 @@\n import { default as getURL, getURLWithCDN } from \"discourse-common/lib/get-url\";\n import { run } from \"@ember/runloop\";\n import { ajax } from \"discourse/lib/ajax\";\n+import { PUBLIC_JS_VERSIONS } from \"discourse/lib/public_js_versions\";\n import { Promise } from \"rsvp\";\n \n const _loaded = {};\n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "In the js world we use `kebab-case` (dasherize) for module names. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -1,7 +1,6 @@\n import AnalyticsClient from './analytics.js';\n import { default as CookieOrginal } from 'js-cookie';\n import glob from '../../../jest/global';\n-import { describe } from 'jest-circus';\n \n jest.mock('js-cookie');\n const Cookie = CookieOrginal;\n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "this was probably automatically imported by my VS Code </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -114,6 +114,7 @@ import { mediaPermissionPromptVisibilityChanged } from './react/features/overlay\n import { suspendDetected } from './react/features/power-monitor';\n import { setSharedVideoStatus } from './react/features/shared-video';\n import { endpointMessageReceived } from './react/features/subtitles';\n+import { getPresenterEffect } from './react/features/presenter';\n \n const logger = require('jitsi-meet-logger').getLogger(__filename);\n \n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "style: sort alphabetically by path </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -109,6 +109,7 @@ import {\n } from './react/features/overlay';\n import { setSharedVideoStatus } from './react/features/shared-video';\n import { isButtonEnabled } from './react/features/toolbox';\n+import { endpointMessageReceived } from './react/features/subtitles';\n \n const logger = require('jitsi-meet-logger').getLogger(__filename);\n \n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "I wonder if endpointMessageReceived should be located somewhere other than subtitles if the endpoint messages could be used for more than subtitles. I suppose it doesn't hurt to keep it in subtitles for now though. </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -1,6 +1,6 @@\n import Vue from 'vue';\n-import { format, parseISO, formatDuration } from 'date-fns';\n-import * as duration from 'duration-fns';\n+import { format, parseISO } from 'date-fns';\n+import * as moment from 'moment';\n \n export const DATE_FORMAT = 'yyyy-MM-dd';\n export const DATE_TIME_FORMAT = 'yyyy-MM-dd HH:mm';\n\nCallgraph: \t[No CFG could be retrieved]\nCodereview: ", "role": "user" }, { "content": "Why do we use both libs? One lib isn't enough? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -30,6 +30,7 @@ import { STORE_NAME as CORE_SITE } from '../datastore/site/constants';\n import { STORE_NAME as CORE_USER } from '../datastore/user/constants';\n \n const MODULE_SLUG = 'test-slug';\n+const TEST_STORE_NAME = 'test/' + MODULE_SLUG;\n \n describe( 'createInfoStore store', () => {\n \tlet registry;\nCallgraph: \t[createInfoStore,registerStore,addQueryArgs,dispatch,it,describe,createTestRegistry,select,unsubscribeFromAll,beforeEach,expect,afterEach]\nCodereview: ", "role": "user" } ]
68f36e4be46f4cce
{ "callgraph": "[AllDataFilesTable->[AllDataFilesTableScan->[newRefinedScan->[AllDataFilesTableScan],planFiles->[schema]]]]", "msg": "I think these can all be .name() to get the value we are looking for", "patch": "@@ -84,6 +84,11 @@ public class AllDataFilesTable extends BaseMetadataTable {\n this.fileSchema = fileSchema;\n }\n \n+ @Override\n+ protected String tableType() {\n+ return String.valueOf(MetadataTableType.ALL_DATA_FILES);\n+ }\n+\n @Override\n protected TableScan newRefinedScan(TableOperations ops, Table table, Schema schema, TableScanContext context) {\n return new AllDataFilesTableScan(ops, table, schema, fileSchema, context);", "summary": "Create a new scan for the given table and schema." }
[ { "content": "Please Give FORMAL Codereview for software developers in one sentence from the given diff hunk. Don’t start with Codereview/review. Just give the answer. Five examples are given before with code and code review and the code to work on is given after.", "role": "user" }, { "content": "Code: \t@@ -94,14 +94,14 @@ public class CreateEmptyPartitionProcedure\n CREATE_EMPTY_PARTITION.bindTo(this));\n }\n \n- public void createEmptyPartition(ConnectorSession session, String schema, String table, List<String> partitionColumnNames, List<String> partitionValues)\n+ public void createEmptyPartition(ConnectorSession session, ConnectorAccessControl accessControl, String schema, String table, List<String> partitionColumnNames, List<String> partitionValues)\n {\n try (ThreadContextClassLoader ignored = new ThreadContextClassLoader(getClass().getClassLoader())) {\n- doCreateEmptyPartition(session, schema, table, partitionColumnNames, partitionValues);\n+ doCreateEmptyPartition(session, accessControl, schema, table, partitionColumnNames, partitionValues);\n }\n }\n \n- private void doCreateEmptyPartition(ConnectorSession session, String schemaName, String tableName, List<String> partitionColumnNames, List<String> partitionValues)\n+ private void doCreateEmptyPartition(ConnectorSession session, ConnectorAccessControl accessControl, String schemaName, String tableName, List<String> partitionColumnNames, List<String> partitionValues)\n {\n TransactionalMetadata hiveMetadata = hiveMetadataFactory.create();\n HiveTableHandle tableHandle = (HiveTableHandle) hiveMetadata.getTableHandle(session, new SchemaTableName(schemaName, tableName));\n\nCallgraph: \t[CreateEmptyPartitionProcedure->[createEmptyPartition->[doCreateEmptyPartition,getClassLoader,ThreadContextClassLoader],doCreateEmptyPartition->[PrestoException,create,equals,toImmutableList,of,finishInsert,beginInsert,wrappedBuffer,empty,getPartitionWriteInfo,SchemaTableName,PartitionUpdate,isPresent,getTableHandle,format,getLocationHandle,getTargetPath,toJsonBytes,collect,getWritePath,commit,makePartName],get->[ArrayType,of,bindTo,Argument,Procedure],HiveMetastoreClosure,requireNonNull,methodHandle]]\nCodereview: ", "role": "user" }, { "content": "Use `SchemaTableName` to format the error message, as above. Maybe extract a variable for the existing `new SchemaTableName(...)` </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -192,6 +192,10 @@ public abstract class HoodieWriteHandle<T extends HoodieRecordPayload> extends H\n \n protected HoodieFileWriter createNewFileWriter(String instantTime, Path path, HoodieTable<T> hoodieTable,\n HoodieWriteConfig config, Schema schema, SparkTaskContextSupplier sparkTaskContextSupplier) throws IOException {\n- return HoodieFileWriterFactory.getFileWriter(instantTime, path, hoodieTable, config, schema, sparkTaskContextSupplier);\n+ if (config.updatePartialFields() && !StringUtils.isNullOrEmpty(config.getLastSchema())) {\n+ return HoodieFileWriterFactory.getFileWriter(instantTime, path, hoodieTable, config, new Schema.Parser().parse(config.getLastSchema()), sparkTaskContextSupplier);\n+ } else {\n+ return HoodieFileWriterFactory.getFileWriter(instantTime, path, hoodieTable, config, schema, sparkTaskContextSupplier);\n+ }\n }\n }\n\nCallgraph: \t[HoodieWriteHandle->[rewriteRecord->[rewriteRecord],makeWriteToken->[makeWriteToken],write->[write]]]\nCodereview: ", "role": "user" }, { "content": "same question as above, is it better to override this only in MergeHandle? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -47,6 +47,11 @@ public class KsqlStream extends StructuredDataSource {\n return new KsqlStream(dataSourceName, schema, keyField, newTimestampField.get(), ksqlTopic);\n }\n \n+ @Override\n+ public QueryId getPersistentQueryId() {\n+ return new QueryId(\"CSAS_\" + dataSourceName);\n+ }\n+\n @Override\n public String toString() {\n return getClass().getSimpleName() + \" name:\" + getName();\n\nCallgraph: \t[KsqlStream->[cloneWithTimeKeyColumns->[KsqlStream],cloneWithTimeField->[KsqlStream]]]\nCodereview: ", "role": "user" }, { "content": "For my understanding, what would be the `dataSourceName` in a statement like `CREATE STREAM enriched_pv as SELECT users.userid AS userid, pageid, region FROM pageviews LEFT JOIN users ON pageviews.userid = users.userid;` </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -151,6 +151,18 @@ public class TestExternalHiveTable\n query(format(\"CREATE TABLE %s.%s.%s WITH (external_location = '%s') AS SELECT * FROM tpch.tiny.nation\", HIVE_CATALOG_WITH_EXTERNAL_WRITES, schema, table, tableLocation));\n }\n \n+ @Test(groups = {HIVE_WITH_EXTERNAL_WRITES, PROFILE_SPECIFIC_TESTS})\n+ public void testCreateExternalTableWithNoSchemaLocation()\n+ {\n+ String schema = \"schema_without_location\";\n+ query(format(\"DROP SCHEMA IF EXISTS %s.%s\", HIVE_CATALOG_WITH_EXTERNAL_WRITES, schema));\n+ query(format(\"CREATE SCHEMA %s.%s\", HIVE_CATALOG_WITH_EXTERNAL_WRITES, schema));\n+\n+ String table = \"test_create_external\";\n+ String tableLocation = \"/tmp/\" + table;\n+ query(format(\"CREATE TABLE %s.%s.%s WITH (external_location = '%s') AS SELECT * FROM tpch.tiny.nation\", HIVE_CATALOG_WITH_EXTERNAL_WRITES, schema, table, tableLocation));\n+ }\n+\n private void insertNationPartition(TableInstance<?> nation, int partition)\n {\n onHive().executeQuery(\n\nCallgraph: \t[TestExternalHiveTable->[insertNationPartition->[executeQuery,getNameInDatabase],testShowStatisticsForExternalTable->[insertNationPartition,getName,get,getNameInDatabase,row,executeQuery,containsOnly],testAnalyzeExternalTable->[insertNationPartition,getName,get,getNameInDatabase,row,containsExactly,executeQuery],testCreateExternalTableWithInaccessibleSchemaLocation->[query,createDirectory,format,delete],testDeleteFromExternalTable->[getName,get,getNameInDatabase,failsWithMessage,executeQuery],getRequirements->[compose,mutableTable],testDeleteFromExternalPartitionedTableTable->[insertNationPartition,getName,get,getNameInDatabase,failsWithMessage,executeQuery,hasRowsCount],testInsertIntoExternalTable->[getName,get,getNameInDatabase,failsWithMessage,executeQuery]]]\nCodereview: ", "role": "user" }, { "content": "Won't this schema have an implicit location of `/usr/hive/warehose/schema_without_location.db` ? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -96,9 +96,14 @@ public abstract class HoodieLazyInsertIterable<T extends HoodieRecordPayload>\n * Transformer function to help transform a HoodieRecord. This transformer is used by BufferedIterator to offload some\n * expensive operations of transformation to the reader thread.\n */\n+ static <T extends HoodieRecordPayload> Function<HoodieRecord<T>, HoodieInsertValueGenResult<HoodieRecord>> getTransformFunction(\n+ Schema schema, HoodieWriteConfig config) {\n+ return hoodieRecord -> new HoodieInsertValueGenResult(hoodieRecord, schema, config.getProps());\n+ }\n+\n static <T extends HoodieRecordPayload> Function<HoodieRecord<T>, HoodieInsertValueGenResult<HoodieRecord>> getTransformFunction(\n Schema schema) {\n- return hoodieRecord -> new HoodieInsertValueGenResult(hoodieRecord, schema);\n+ return hoodieRecord -> new HoodieInsertValueGenResult(hoodieRecord, schema, CollectionUtils.EMPTY_PROPERTIES);\n }\n \n @Override\n\nCallgraph: \t[HoodieLazyInsertIterable->[getTransformFunction->[HoodieInsertValueGenResult]]]\nCodereview: ", "role": "user" }, { "content": "this is a function invoked per record. so could we avoid the empty `new Properties` allocation each time, to reduce overhead on each record </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -84,6 +84,11 @@ public class AllDataFilesTable extends BaseMetadataTable {\n this.fileSchema = fileSchema;\n }\n \n+ @Override\n+ protected String tableType() {\n+ return String.valueOf(MetadataTableType.ALL_DATA_FILES);\n+ }\n+\n @Override\n protected TableScan newRefinedScan(TableOperations ops, Table table, Schema schema, TableScanContext context) {\n return new AllDataFilesTableScan(ops, table, schema, fileSchema, context);\nCallgraph: \t[AllDataFilesTable->[AllDataFilesTableScan->[newRefinedScan->[AllDataFilesTableScan],planFiles->[schema]]]]\nCodereview: ", "role": "user" } ]
c733dad0abcbf8f4
{ "callgraph": "[applyProgramsToDirtyDataInterfaces->[setAcceptLocal]]", "msg": "nit: a switch perhaps?", "patch": "@@ -614,6 +614,8 @@ func (m *bpfEndpointManager) attachDataIfaceProgram(ifaceName string, polDirecti\n \tepType := tc.EpTypeHost\n \tif ifaceName == \"tunl0\" {\n \t\tepType = tc.EpTypeTunnel\n+\t} else if ifaceName == \"wireguard.cali\" {\n+\t\tepType = tc.EpTypeWireguard\n \t}\n \tap := m.calculateTCAttachPoint(epType, polDirection, ifaceName)\n \tap.HostIP = m.hostIP", "summary": "attachDataIfaceProgram attaches the data interface program to the endpoint." }
[ { "content": "Please Give FORMAL Codereview for software developers in one sentence from the given diff hunk. Don’t start with Codereview/review. Just give the answer. Five examples are given before with code and code review and the code to work on is given after.", "role": "user" }, { "content": "Code: \t@@ -101,12 +101,10 @@ func (m MapStr) Clone() MapStr {\n \tresult := MapStr{}\n \n \tfor k, v := range m {\n-\t\tinnerMap, err := toMapStr(v)\n-\t\tif err == nil {\n-\t\t\tresult[k] = innerMap.Clone()\n-\t\t} else {\n-\t\t\tresult[k] = v\n+\t\tif innerMap, ok := tryToMapStr(v); ok {\n+\t\t\tv = innerMap.Clone()\n \t\t}\n+\t\tresult[k] = v\n \t}\n \n \treturn result\n\nCallgraph: \t[StringToPrint->[MarshalIndent,Sprintf],String->[Marshal,Sprintf],Clone->[Clone],Wrapf,Join,Do,New,DeepUpdate,Errorf,Split]\nCodereview: ", "role": "user" }, { "content": "Kind of surprised to see a mapstr change in this PR. Why was that needed? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -382,6 +382,9 @@ func buildFlagsWrapperToOptions(c *cobra.Command, contextDir string, flags *buil\n \t}\n \n \tcontainerConfig := registry.PodmanConfig()\n+\tfor _, arg := range containerConfig.RuntimeFlags {\n+\t\truntimeFlags = append(runtimeFlags, \"--\"+arg)\n+\t}\n \tif containerConfig.Engine.CgroupManager == config.SystemdCgroupsManager {\n \t\truntimeFlags = append(runtimeFlags, \"--systemd-cgroup\")\n \t}\n\nCallgraph: \t[RemoveAll,Dir,IsolationOption,IDMappingOptions,Close,RAMInBytes,LookupEnv,MarkHidden,HasPrefix,Exit,Set,SystemContextFromOptions,New,Errorf,TempDirForURL,GetContext,SplitN,IsAbs,PodmanConfig,Wrapf,GetFromAndBudFlags,Join,BoolVarP,Lookup,ToLower,NewImageEngine,Build,Flag,IsDir,AddFlagSet,Changed,GetBudFlags,GetLayerFlags,SetOutput,Abs,FileExists,OpenFile,Getenv,MaximumNArgs,Flags]\nCodereview: ", "role": "user" }, { "content": "Is this correct? It looks questionable </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -491,6 +491,8 @@ func (m *ChatRemoteMock) PostRemote(ctx context.Context, arg chat1.PostRemoteArg\n \tconv := m.world.GetConversationByID(arg.ConversationID)\n \tri := m.makeReaderInfo(conv.Metadata.ConversationID)\n \tinserted := m.insertMsgAndSort(arg.ConversationID, arg.MessageBoxed)\n+\tm.world.T.Logf(\"PostRemote(convid:%v, msgid:%v, %v)\",\n+\t\targ.ConversationID, inserted.ServerHeader.MessageID, arg.MessageBoxed.GetMessageType())\n \tif ri.ReadMsgid == ri.MaxMsgid {\n \t\tm.readMsgid[arg.ConversationID.String()] = inserted.ServerHeader.MessageID\n \t}\n\nCallgraph: \t[MarkAsRead->[GetConversationByID],Cleanup->[Cleanup],SyncAll->[SyncChat],GetInboxRemote->[inConversation,makeReaderInfo],Lookup->[getTlfID],CryptKeys->[getTlfID],PostRemote->[headerToVerifiedForTesting,makeReaderInfo,createBogusBody,promoteWriter,GetConversationByID],GetPublicConversations->[makeReaderInfo],GetInboxByTLFIDRemote->[makeReaderInfo],CompleteAndCanonicalizePrivateTlfName->[getTlfID],Less->[makeReaderInfo],GetConversationMetadataRemote->[GetConversationByID]]\nCodereview: ", "role": "user" }, { "content": "Do you want to keep this? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -100,12 +100,9 @@ func (m *MergeChecker) Check(region *core.RegionInfo) []*Operator {\n \n \tprev, next := m.cluster.GetAdjacentRegions(region)\n \n-\tvar target *core.RegionInfo\n-\ttargetNext := m.checkTarget(region, next, target)\n-\ttarget = m.checkTarget(region, prev, target)\n-\tif target != targetNext && m.cluster.GetEnableOneWayMerge() {\n-\t\tcheckerCounter.WithLabelValues(\"merge_checker\", \"skip_left\").Inc()\n-\t\ttarget = targetNext\n+\ttarget := m.checkTarget(region, next, nil)\n+\tif !m.cluster.GetEnableOneWayMerge() {\n+\t\ttarget = m.checkTarget(region, prev, target)\n \t}\n \n \tif target == nil {\n\nCallgraph: \t[RecordRegionSplit->[GetSplitMergeInterval,PutWithTTL],Check->[GetEnableOneWayMerge,Exists,Inc,checkTarget,GetApproximateKeys,GetID,GetPendingPeers,GetLearners,RegionToHexMeta,GetAdjacentRegions,Stringer,WithLabelValues,GetDownPeers,Debug,GetPeers,GetMaxMergeRegionSize,GetApproximateSize,IsRegionHot,GetMeta,GetMaxMergeRegionKeys,GetMaxReplicas],checkTarget->[GetPeers,GetID,GetPendingPeers,GetLearners,GetApproximateSize,AllowMerge,IsRegionHot,GetDownPeers,GetMaxReplicas],GetSplitMergeInterval,NewIDTTL,Put]\nCodereview: ", "role": "user" }, { "content": "BTW, do we need to keep the metrics? </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -165,7 +165,8 @@ func getIPAMConfig(clusterNetworks []common.ClusterNetwork, localSubnet string)\n // Start the CNI server and start processing requests from it\n func (m *podManager) Start(socketPath string, localSubnetCIDR string, clusterNetworks []common.ClusterNetwork) error {\n \tif m.enableHostports {\n-\t\tm.hostportSyncer = kubehostport.NewHostportSyncer()\n+\t\tiptInterface := utiliptables.New(utilexec.New(), utildbus.New(), utiliptables.ProtocolIpv4)\n+\t\tm.hostportSyncer = kubehostport.NewHostportSyncer(iptInterface)\n \t}\n \n \tvar err error\n\nCallgraph: \t[teardown->[shouldSyncHostports,ipamDel],UpdateLocalMulticastRules->[updateLocalMulticastRulesWithLock],setup->[ipamAdd,shouldSyncHostports,ipamDel],Start->[Start],handleCNIRequest->[waitRequest,addRequest],processRequest->[updateLocalMulticastRulesWithLock]]\nCodereview: ", "role": "user" }, { "content": "is this a boring change? cc @openshift/sig-networking </s>\n\n", "role": "assistant" }, { "content": "Code: \t@@ -614,6 +614,8 @@ func (m *bpfEndpointManager) attachDataIfaceProgram(ifaceName string, polDirecti\n \tepType := tc.EpTypeHost\n \tif ifaceName == \"tunl0\" {\n \t\tepType = tc.EpTypeTunnel\n+\t} else if ifaceName == \"wireguard.cali\" {\n+\t\tepType = tc.EpTypeWireguard\n \t}\n \tap := m.calculateTCAttachPoint(epType, polDirection, ifaceName)\n \tap.HostIP = m.hostIP\nCallgraph: \t[applyProgramsToDirtyDataInterfaces->[setAcceptLocal]]\nCodereview: ", "role": "user" } ]
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
10