patch
stringlengths
17
31.2k
y
int64
1
1
oldf
stringlengths
0
2.21M
idx
int64
1
1
id
int64
4.29k
68.4k
msg
stringlengths
8
843
proj
stringclasses
212 values
lang
stringclasses
9 values
@@ -19,6 +19,8 @@ package org.openqa.grid.internal; import com.google.common.base.Predicate; +import com.sun.org.glassfish.gmbal.ManagedObject; + import net.jcip.annotations.ThreadSafe; import org.openqa.grid.internal.listeners.Prioritizer;
1
/* Copyright 2011 Selenium committers Copyright 2011 Software Freedom Conservancy Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by...
1
11,529
JMX offers normal APIs for this. I don't think you want the glassfish one.
SeleniumHQ-selenium
rb
@@ -0,0 +1,7 @@ +module io.vavr { + requires io.vavr.match; + exports io.vavr; + exports io.vavr.collection; + exports io.vavr.control; + exports io.vavr.concurrent; +}
1
1
12,294
Is this still Java 8 compatible? @danieldietrich do we need a separate, modularized Java 9 release also?
vavr-io-vavr
java
@@ -293,7 +293,12 @@ hipError_t hipCreateTextureObject(hipTextureObject_t* pTexObject, const hipResou hsa_ext_sampler_descriptor_t samplerDescriptor; fillSamplerDescriptor(samplerDescriptor, pTexDesc->addressMode[0], pTexDesc->filterMode, pTexDesc->normalizedCoords); - +...
1
#include <map> #include <string.h> #include "hsa/hsa.h" #include "hsa/hsa_ext_amd.h" #include "hip/hip_runtime.h" #include "hip_hcc_internal.h" #include "trace_helper.h" #include "hip_texture.h" static std::map<hipTextureObject_t, hipTexture*> textureHash; void saveTextureInfo(const hipTexture* pTexture, const h...
1
8,820
Should update the user input address and filter modes and pass those in fillSamplerDescriptor ?
ROCm-Developer-Tools-HIP
cpp
@@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Faker + class Show < Base + class << self + def adult_musical + fetch('show.adult_musical') + end + + def kids_musical + fetch('show.kids_musical') + end + + def play + fetch('show.play') + end + end + e...
1
1
8,932
This object should be in `lib/music/show.rb` and you should also wrap this object in the `Faker::Music::Show`.
faker-ruby-faker
rb
@@ -58,6 +58,14 @@ Puppet::Functions.create_function(:run_task) do end || (raise Puppet::ParseError, 'Task parameters did not match') task = task_signature.task + if executor.noop + if task.supports_noop + use_args['_noop'] = true + else + raise Puppet::ParseError, 'Task does not ...
1
# Runs a given instance of a `Task` on the given set of targets and returns the result from each. # # * This function does nothing if the list of targets is empty. # * It is possible to run on the target 'localhost' # * A target is a String with a targets's hostname or a Target. # * The returned value contains informat...
1
7,260
I think logic will have to move to bolt since the vague discussions around bolt run plan --noop is that it would just skip any tasks that don't support_noop rather than error. This is fine until we actually elaborate that though.
puppetlabs-bolt
rb
@@ -11,6 +11,7 @@ import ( "github.com/CoderZhi/go-ethereum/common" "github.com/CoderZhi/go-ethereum/core/types" + "github.com/iotexproject/iotex-core/address" "github.com/iotexproject/iotex-core/logger" "github.com/iotexproject/iotex-core/pkg/hash"
1
// Copyright (c) 2018 IoTeX // This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no // warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent // permitted by law, all liability for your use of the cod...
1
13,092
File is not `goimports`-ed
iotexproject-iotex-core
go
@@ -35,12 +35,15 @@ class CollectionViewTest(BaseWebTest, unittest.TestCase): headers=self.headers, status=400) - def test_unknown_bucket_raises_404(self): + def test_unknown_bucket_raises_403(self): other_bucket = self.collections_url.replace('beer...
1
from .support import (BaseWebTest, unittest, MINIMALIST_BUCKET, MINIMALIST_COLLECTION, MINIMALIST_RECORD) class CollectionViewTest(BaseWebTest, unittest.TestCase): collections_url = '/buckets/beers/collections' collection_url = '/buckets/beers/collections/barley' def setUp(self): ...
1
7,452
why should unknown raise a 403?
Kinto-kinto
py
@@ -87,11 +87,11 @@ export function diff(dom, parentDom, newVNode, oldVNode, context, isSvg, excessD c._vnode = newVNode; // Invoke getDerivedStateFromProps - let s = c._nextState || c.state; + if (c._nextState==null) { + c._nextState = c.state; + } if (newType.getDerivedStateFromProps!=null) { -...
1
import { EMPTY_OBJ, EMPTY_ARR } from '../constants'; import { Component, enqueueRender } from '../component'; import { coerceToVNode, Fragment } from '../create-element'; import { diffChildren } from './children'; import { diffProps } from './props'; import { assign, removeNode } from '../util'; import options from '.....
1
12,883
The true clause of your condition, can't this just be c._nextState since `assign({}, c._nextState)` is equal to returning c._nextState, or am I misunderstanding something here?
preactjs-preact
js
@@ -36,6 +36,8 @@ flags.DEFINE_string('groups_service_account_key_file', None, 'runnning locally.') flags.DEFINE_integer('max_admin_api_calls_per_day', 150000, 'Admin SDK queries per day.') +flags.DEFINE_integer('max_results_admin_api', 500, ++ 'maxResult ...
1
# Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
1
25,694
nit: align the leftmost quotes
forseti-security-forseti-security
py
@@ -98,6 +98,11 @@ type AgentConfig struct { // APIPort is the port for the antrea-agent APIServer to serve on. // Defaults to 10350. APIPort int `yaml:"apiPort,omitempty"` + + // ClusterMembershipPort is the server port used by the antrea-agent to run a gossip-based cluster membership protocol. Currently it's us...
1
// Copyright 2019 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to ...
1
37,518
Probably "server port" -> "TCP port"
antrea-io-antrea
go
@@ -91,7 +91,11 @@ public class Lucene80Codec extends Codec { * flushed/merged segments. */ public Lucene80Codec(Mode mode) { - super("Lucene80"); + this("Lucene80", mode); + } + + protected Lucene80Codec(String name, Mode mode) { + super(name); this.storedFieldsFormat = new Luc...
1
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may ...
1
28,865
can you use FilterCodec instead?
apache-lucene-solr
java
@@ -407,6 +407,19 @@ class Setting extends BaseModel { tagHeaderIsExpanded: { value: true, type: Setting.TYPE_BOOL, public: false, appTypes: ['desktop'] }, folderHeaderIsExpanded: { value: true, type: Setting.TYPE_BOOL, public: false, appTypes: ['desktop'] }, editor: { value: '', type: Setting.TYPE_STRING, ...
1
const BaseModel = require('lib/BaseModel.js'); const { Database } = require('lib/database.js'); const SyncTargetRegistry = require('lib/SyncTargetRegistry.js'); const { time } = require('lib/time-utils.js'); const { sprintf } = require('sprintf-js'); const ObjectUtils = require('lib/ObjectUtils'); const { toTitleCase }...
1
10,525
I know there's only two values but I find it a bit confusing that it's true/false. Could you change it to a string enum with values "portrait" and "landscape"? Then when calling printToPdf you can just do `landscape: Setting.value('export.pdfPageOrientation') === 'landscape'`
laurent22-joplin
js
@@ -12,3 +12,11 @@ var dbSchemaVersion = Migration{ return CommitProgress(db, nil, true) }, } + +var dbSchemaVersion2 = Migration{ + Name: "db_schema_version2", + Up: func(db ethdb.Database, tmpdir string, progress []byte, CommitProgress etl.LoadCommitHandler) (err error) { + // This migration is no-op, but it f...
1
package migrations import ( "github.com/ledgerwatch/erigon/common/etl" "github.com/ledgerwatch/erigon/ethdb" ) var dbSchemaVersion = Migration{ Name: "db_schema_version", Up: func(db ethdb.Database, tmpdir string, progress []byte, CommitProgress etl.LoadCommitHandler) (err error) { // This migration is no-op, b...
1
22,209
I think this migration should fail for MDBX if it uses old table names
ledgerwatch-erigon
go
@@ -224,7 +224,7 @@ module Beaker # @raise [ArgumentError] if a hosts file is generated, but it can't # be read by the HostsFileParser def parse_hosts_options - if File.exists?(@options[:hosts_file]) + if @options[:hosts_file].nil? || File.exists?(@options[:hosts_file]) #...
1
require 'yaml' module Beaker module Options #An Object that parses, merges and normalizes all supported Beaker options and arguments class Parser GITREPO = 'git://github.com/puppetlabs' #These options can have the form of arg1,arg2 or [arg] or just arg, #should default to [] LONG...
1
13,926
Should this be negated? `!@options[:hosts_file].nil?` Otherwise it'll enter the `if` statement and `nil` will be passed to `HostsFileParser.parse_hosts_file`, which I'm assuming is bad.
voxpupuli-beaker
rb
@@ -91,6 +91,14 @@ namespace NLog /// Loads NLog config created by the method <paramref name="configBuilder"/> /// </summary> public static ISetupBuilder LoadConfiguration(this ISetupBuilder setupBuilder, Action<ISetupLoadConfigurationBuilder> configBuilder) + { + return Loa...
1
// // Copyright (c) 2004-2020 Jaroslaw Kowalski <jaak@jkowalski.net>, Kim Christensen, Julian Verdurmen // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // // * Redistributions of ...
1
21,340
I'm doubting if adding a bool here is a good idea. Maybe it should be an option object? Otherwise it's hard to extend. But an option object is a bit strange in a fluent API? What do you think @snakefoot ?
NLog-NLog
.cs
@@ -410,7 +410,7 @@ public class MultiPhraseQuery extends Query { * <p> * Note: positions are merged during freq() */ - static class UnionPostingsEnum extends PostingsEnum { + public static class UnionPostingsEnum extends PostingsEnum { /** queue ordered by docid */ final DocsQueue docsQueue; ...
1
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may ...
1
38,034
This is used in o.a.l.sandbox.search.PhraseWildcardQuery.
apache-lucene-solr
java
@@ -42,6 +42,7 @@ type stateDB struct { dao db.KVStore // the underlying DB for account/contract storage timerFactory *prometheustimer.TimerFactory workingsets *lru.Cache // lru cache for workingsets + protocolView protocol.Dock } // StateDBOption sets stateDB construction pa...
1
// Copyright (c) 2020 IoTeX Foundation // This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no // warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent // permitted by law, all liability for your use...
1
21,515
view should be loaded on start for both statedb and factory
iotexproject-iotex-core
go
@@ -31,7 +31,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Http private ConnectionFilterContext _filterContext; private LibuvStream _libuvStream; private FilteredStreamAdapter _filteredStreamAdapter; - private Task _readInputContinuation; + private Task _readInputTask; ...
1
// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Server.Kestrel.Filter; using Microsoft.AspNetCore.Server....
1
8,623
Why rename? Just curious...
aspnet-KestrelHttpServer
.cs
@@ -309,12 +309,14 @@ public class VideoplayerActivity extends MediaplayerActivity { public void onStartTrackingTouch(SeekBar seekBar) { super.onStartTrackingTouch(seekBar); videoControlsHider.stop(); + controls.setVisibility(View.GONE); } @Override public void onStopTrack...
1
package de.danoeh.antennapod.activity; import android.annotation.SuppressLint; import android.content.Intent; import android.graphics.drawable.ColorDrawable; import android.os.Build; import android.os.Bundle; import android.os.Handler; import androidx.core.view.WindowCompat; import androidx.appcompat.app.ActionBar; im...
1
15,883
Is this needed? I think it calls the super function that already does that.
AntennaPod-AntennaPod
java
@@ -538,7 +538,9 @@ class BBoxHead(BaseModule): labels = labels.view(1, 1, -1).expand_as(scores) labels = labels.reshape(batch_size, -1) scores = scores.reshape(batch_size, -1) - bboxes = bboxes.reshape(batch_size, -1, 4) + if self.reg_class_agnostic: + bboxes = bboxe...
1
import torch import torch.nn as nn import torch.nn.functional as F from mmcv.runner import BaseModule, auto_fp16, force_fp32 from torch.nn.modules.utils import _pair from mmdet.core import build_bbox_coder, multi_apply, multiclass_nms from mmdet.models.builder import HEADS, build_loss from mmdet.models.losses import a...
1
24,237
This might slow down the inference time, are we sure we need to do that?
open-mmlab-mmdetection
py
@@ -23,11 +23,9 @@ import ( ) func Example() { - // This example is used in https://gocloud.dev/howto/sql/#aws - - // import _ "gocloud.dev/mysql/awsmysql" - - // Variables set up elsewhere: + // PRAGMA(gocloud.dev): Package this example for gocloud.dev. + // PRAGMA(gocloud.dev): Add a blank import: _ "gocloud.dev/...
1
// Copyright 2018 The Go Cloud Development Kit Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by appli...
1
19,583
This would read better if you add "Skip code/lines" or (exclude/hide code if you follow my earlier suggestion")
google-go-cloud
go
@@ -34,6 +34,13 @@ import java.util.HashSet; import java.util.Map; import javax.imageio.ImageIO; import org.apache.commons.io.IOUtils; +import static edu.harvard.iq.dataverse.dataaccess.DataAccess.getStorageIO; +import static edu.harvard.iq.dataverse.dataaccess.DataAccess.getStorageIO; +import static edu.harvard.iq....
1
package edu.harvard.iq.dataverse.dataset; import edu.harvard.iq.dataverse.DataFile; import edu.harvard.iq.dataverse.Dataset; import edu.harvard.iq.dataverse.DatasetField; import edu.harvard.iq.dataverse.DatasetVersion; import edu.harvard.iq.dataverse.FileMetadata; import edu.harvard.iq.dataverse.dataaccess.DataAccess;...
1
39,312
Looks like glassfish went a bit nuts doing a refactor
IQSS-dataverse
java
@@ -84,6 +84,17 @@ namespace OpenTelemetry.Trace.Export.Internal return Task.WhenAll(tasks); } + public override Task ForceFlushAsync(CancellationToken cancellationToken) + { + var tasks = new List<Task>(); + foreach (var processor in this.processors) + ...
1
// <copyright file="BroadcastActivityProcessor.cs" company="OpenTelemetry Authors"> // Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http:...
1
14,567
nit: allocate the list using the number of processors.
open-telemetry-opentelemetry-dotnet
.cs
@@ -142,10 +142,10 @@ public class PartitionSpec implements Serializable { public String partitionToPath(StructLike data) { StringBuilder sb = new StringBuilder(); - Class<?>[] javaClasses = javaClasses(); - for (int i = 0; i < javaClasses.length; i += 1) { + Class<?>[] initializedClasses = javaClass...
1
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you ...
1
13,085
Was this change triggered by baseline?
apache-iceberg
java
@@ -36,17 +36,13 @@ class OrgThirtyDayActivity < ActiveRecord::Base private def with_commits_and_affiliates - orgs = Organization.arel_table joins(:organization) - .where(id: orgs[:thirty_day_activity_id]) .where(arel_table[:thirty_day_commit_count].gt(0) .and(arel_table...
1
class OrgThirtyDayActivity < ActiveRecord::Base SORT_TYPES = [['All Organizations', 'all_orgs'], %w(Commercial commercial), %w(Education educational), %w(Government government), %w(Non-Profit non_profit), %w(Large large), %w(Medium medium), %w(Small small)] FILTER_TYPES = { all_orgs...
1
7,980
This code was doing nothing as far as I can tell and was making the SQL find nothing with the new version of Rails. Remove it unless someone can explain why it is there.
blackducksoftware-ohloh-ui
rb
@@ -39,6 +39,7 @@ public class RestExplorerApp extends Application { public void onCreate() { super.onCreate(); SalesforceSDKManager.initNative(getApplicationContext(), new KeyImpl(), ExplorerActivity.class); + SalesforceSDKManager.getInstance().setBrowserLoginEnabled(true); /* * Un-comment the line b...
1
/* * Copyright (c) 2011-present, salesforce.com, inc. * All rights reserved. * Redistribution and use of this software in source and binary forms, with or * without modification, are permitted provided that the following conditions * are met: * - Redistributions of source code must retain the above copyright noti...
1
16,099
Setting browser based login as the default for `RestAPIExplorer`.
forcedotcom-SalesforceMobileSDK-Android
java
@@ -231,6 +231,11 @@ void DataParallelTreeLearner<TREELEARNER_T>::FindBestSplitsFromHistograms(const } // sync global best info + auto max_cat_threshold = this->config_->max_cat_threshold; + int splitInfoSize = SplitInfo::Size(max_cat_threshold); + if (input_buffer_.size() < splitInfoSize * 2) { + input_b...
1
/*! * Copyright (c) 2016 Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See LICENSE file in the project root for license information. */ #include <cstring> #include <tuple> #include <vector> #include "parallel_tree_learner.h" namespace LightGBM { template <typename TREELEARNER_T> Da...
1
24,142
maybe we can do this in Init function?
microsoft-LightGBM
cpp
@@ -2086,10 +2086,15 @@ func (wh *WorkflowHandler) ResetWorkflowExecution(ctx context.Context, request * if request == nil { return nil, errRequestNotSet } - if request.GetNamespace() == "" { return nil, errNamespaceNotSet } + if request.GetRequestId() == "" { + return nil, errRequestIDNotSet + } + if le...
1
// The MIT License // // Copyright (c) 2020 Temporal Technologies Inc. All rights reserved. // // Copyright (c) 2020 Uber Technologies, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Soft...
1
13,176
How about if request ID not set, service should generate a random uuid?
temporalio-temporal
go
@@ -105,7 +105,7 @@ func TestPerformUpdateWithUpdatesDisabled(t *testing.T) { Reason: ptr("Updates are disabled").(*string), }}) - u.performUpdateHandler(statemanager.NewNoopStateManager(), engine.NewTaskEngine(cfg, nil, nil, nil, nil, nil, nil))(&ecsacs.PerformUpdateMessage{ + u.performUpdateHandler(...
1
// Copyright 2014-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"). You may // not use this file except in compliance with the License. A copy of the // License is located at // // http://aws.amazon.com/apache2.0/ // // or in the "license...
1
18,807
minor: this is an opportunity for you to split these long lines into multiple lines :)
aws-amazon-ecs-agent
go
@@ -259,7 +259,10 @@ class RequestsParser(object): req = ensure_is_dict(raw_requests, key, "url") if not require_url and "url" not in req: req["url"] = None - requests.append(self.__parse_request(req)) + try: + requests.append(self.__parse_...
1
""" Copyright 2017 BlazeMeter Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software...
1
14,986
It would be nice to have exception dumped somewhere (debug logs, info logs).
Blazemeter-taurus
py
@@ -84,6 +84,13 @@ type Topic interface { // https://github.com/google/go-cloud/blob/master/internal/docs/design.md#as // for more background. As(i interface{}) bool + + // As allows providers to expose provider-specific types. + // + // See + // https://github.com/google/go-cloud/blob/master/internal/docs/design...
1
// Copyright 2018 The Go Cloud Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agr...
1
12,775
So I don't think this is right, as discussed on #657.
google-go-cloud
go
@@ -65,10 +65,16 @@ GROUP_IDS = """ SELECT group_id from groups_{0}; """ -GROUP_USERS = """ +GROUP_ID = """ + SELECT group_id + FROM groups_{1} + WHERE group_email = "{0}"; +""" + +GROUP_MEMBERS = """ SELECT group_id, member_role, member_type, member_id, member_email - FROM group_members_{0} - ...
1
# Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
1
25,822
should the group_id = "{0}" be group_id = %s You'd still keep the {} for the group_members_{} for the tablename but make the filter clause parameterized.
forseti-security-forseti-security
py
@@ -89,7 +89,12 @@ class HierarchicHTTPRequest(HTTPRequest): raise TaurusConfigError("Items from upload-files must specify parameter name") path_exc = TaurusConfigError("Items from upload-files must specify path to file") - file_dict["path"] = get_full_path(self.engine.find_fi...
1
""" Copyright 2017 BlazeMeter Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software...
1
14,674
Path can contain variable pattern in the middle. Also, `$` is not enough to tell if this is JMeter variable. We have correct variable detecting somewhere in our code.
Blazemeter-taurus
py
@@ -20,6 +20,11 @@ class FormTestModel extends Model { return ['dropdown', 'options']; } + + public function staticMethodOptions() + { + return ['static', 'method']; + } } class FormHelper
1
<?php use Backend\Widgets\Form; use Illuminate\Database\Eloquent\Model; use October\Tests\Fixtures\Backend\Models\UserFixture; class FormTestModel extends Model { public function modelCustomOptionsMethod() { return ['model', 'custom', 'options']; } public function getFieldNameOnModelOptionsMe...
1
19,137
@bennothommo can you revert this section? It shouldn't be required.
octobercms-october
php
@@ -92,9 +92,13 @@ module Ncr "ncr" end - # @todo - this is pretty ugly def public_identifier - self.cart.id + fiscal_year = self.created_at.year + if self.created_at.month >= 10 + fiscal_year += 1 + end + fiscal_year = fiscal_year % 100 # convert to two-digit + ...
1
module Ncr # Make sure all table names use 'ncr_XXX' def self.table_name_prefix 'ncr_' end DATA = YAML.load_file("#{Rails.root}/config/data/ncr.yaml") EXPENSE_TYPES = %w(BA61 BA80) BUILDING_NUMBERS = DATA['BUILDING_NUMBERS'] OFFICES = DATA['OFFICES'] class WorkOrder < ActiveRecord::Base # TO...
1
12,966
Minor: maybe move the above to a `#fiscal_year` method?
18F-C2
rb
@@ -62,3 +62,13 @@ class BuildTest(QuiltTestCase): 'Expected dataframes to have same # columns' del os.environ["QUILT_PACKAGE_FORMAT"] # TODO add more integrity checks, incl. negative test cases + + def test_generate_buildfile(self): + mydir = os.path.dirname(__file__) + ...
1
""" Test the build process """ #TODO: we should really test the CLI interface itself, rather than #the functions that cli calls import os try: import fastparquet except ImportError: fastparquet = None import pytest from quilt.tools import build from quilt.tools.const import FORMAT_PARQ from .utils import Qui...
1
14,866
You should use the current directory instead - it's a temporary directory that will get removed when the test is done.
quiltdata-quilt
py
@@ -549,7 +549,7 @@ public class ContainerizedDispatchManagerTest { this.containerizedDispatchManager.getExecutionDispatcher(this.flow1.getExecutionId())); thread.start(); synchronized (thread) { - thread.wait(); + thread.join(); } assertThat(flow1.getStatus()).isEqualTo(Status.FA...
1
/* * Copyright 2020 LinkedIn Corp. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to i...
1
22,722
I think we don't need synchronization here.
azkaban-azkaban
java
@@ -92,7 +92,7 @@ public final class OAuth2AuthorizedClientArgumentResolver implements HandlerMeth clientRegistrationId.flatMap(id -> Mono.error(new IllegalStateException( "Unable to resolve the Authorized Client with registration identifier \"" + id - + "\". An \"authenticated\"...
1
/* * Copyright 2002-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by ap...
1
10,262
I don't think this should be changed since on the reactive side we don't support anonymous users.
spring-projects-spring-security
java
@@ -116,7 +116,7 @@ module Mongoid before_destroy do if record = __send__(name) - record[cache_column] = (record[cache_column] || 0) - 1 + record[cache_column] = (record[cache_column] || 0) - 1 unless record.frozen? if record.persisted? ...
1
# encoding: utf-8 module Mongoid module Relations module CounterCache extend ActiveSupport::Concern # Reset the given counter using the .count() query from the # db. This method is usuful in case that a counter got # corrupted, or a new counter was added to the collection. # #...
1
11,004
Maybe this `if` should be on line 118?
mongodb-mongoid
rb
@@ -45,8 +45,8 @@ type ( // the less than equal bucket count for the pre-determined boundaries. state struct { bucketCounts []float64 - count metric.Number sum metric.Number + count int64 } )
1
// Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agre...
1
12,766
Cool. (I thought I had fixed this already in #812.)
open-telemetry-opentelemetry-go
go
@@ -36,7 +36,7 @@ module Bolt TRANSPORT_OPTIONS = %i[password run-as sudo-password extensions private-key tty tmpdir user connect-timeout - cacert token-file service-url].freeze + cacert token-file service-url interpreters].freeze ...
1
# frozen_string_literal: true require 'yaml' require 'logging' require 'concurrent' require 'pathname' require 'bolt/boltdir' require 'bolt/transport/ssh' require 'bolt/transport/winrm' require 'bolt/transport/orch' require 'bolt/transport/local' require 'bolt/transport/docker' require 'bolt/transport/remote' module ...
1
10,649
I intend to do this as soon as I have tests passing.
puppetlabs-bolt
rb
@@ -0,0 +1,7 @@ +#!/usr/bin/python3 + +import sys +import os +sys.stdin.read() +with open(os.environ['QUTE_FIFO'], 'wb') as fifo: + fifo.write(b':message-info "stdin closed"\n')
1
1
18,000
Please remove the `test_*` from the filename - otherwise pytest will try to collect tests from it.
qutebrowser-qutebrowser
py
@@ -263,6 +263,11 @@ size_t wlr_session_find_gpus(struct wlr_session *session, return explicit_find_gpus(session, ret_len, ret, explicit); } +#ifdef __FreeBSD__ + // XXX: libudev-devd does not return any GPUs (yet?) + return explicit_find_gpus(session, ret_len, ret, "/dev/drm/0"); +#else + struct udev_enumerat...
1
#define _POSIX_C_SOURCE 200809L #include <assert.h> #include <stddef.h> #include <stdlib.h> #include <string.h> #include <sys/stat.h> #include <sys/types.h> #include <libudev.h> #include <wayland-server.h> #include <xf86drm.h> #include <xf86drmMode.h> #include <wlr/backend/session.h> #include <wlr/backend/session/inter...
1
8,356
Did you file a bug to follow up on this?
swaywm-wlroots
c
@@ -156,10 +156,13 @@ class Reader implements DataSourceReader, SupportsScanColumnarBatch, SupportsPus this.io = io; this.encryptionManager = encryptionManager; this.caseSensitive = caseSensitive; - - this.batchReadsEnabled = options.get("vectorization-enabled").map(Boolean::parseBoolean).orElseGet(()...
1
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you ...
1
27,945
Looks like these 4 lines didn't actually change. Can you revert the whitespace changes here?
apache-iceberg
java
@@ -1,4 +1,6 @@ RSpec::Support.require_rspec_core "formatters/base_formatter" +require 'pathname' + module RSpec module Core
1
RSpec::Support.require_rspec_core "formatters/base_formatter" module RSpec module Core module Formatters # @private class FailureListFormatter < BaseFormatter Formatters.register self, :example_failed, :dump_profile, :message def example_failed(failure) output.puts "#{failu...
1
18,069
This can't be merged with any usage of `require 'pathname'` in lib, it's not always available and we don't want false positives for people (where they don't realise they needed to requite it). Its also unnecessary, no other formatter uses it to look up failure locations. See the exception presenter etc for how we forma...
rspec-rspec-core
rb
@@ -1426,6 +1426,13 @@ public class DatasetsIT { // This should fail, because we are attempting to link the dataset // to its own dataverse: + Response publishTargetDataverse = UtilIT.publishDataverseViaNativeApi(dataverseAlias, apiToken); + publishTargetDataverse.prettyPrint...
1
package edu.harvard.iq.dataverse.api; import com.jayway.restassured.RestAssured; import static com.jayway.restassured.RestAssured.given; import com.jayway.restassured.http.ContentType; import com.jayway.restassured.response.Response; import java.util.logging.Logger; import org.junit.BeforeClass; import org.junit.Test;...
1
38,719
It would be nice to fix the indentation above.
IQSS-dataverse
java
@@ -9334,8 +9334,8 @@ return [ 'openssl_x509_export_to_file' => ['bool', 'certificate'=>'string|resource', 'output_filename'=>'string', 'no_text='=>'bool'], 'openssl_x509_fingerprint' => ['string|false', 'certificate'=>'string|resource', 'digest_algo='=>'string', 'binary='=>'bool'], 'openssl_x509_free' => ['void', '...
1
<?php // phpcs:ignoreFile namespace Phan\Language\Internal; /** * CURRENT PHP TARGET VERSION: 8.0 * The version above has to match Psalm\Internal\Codebase\InternalCallMapHandler::PHP_(MAJOR|MINOR)_VERSION * * Format * * '<function_name>' => ['<return_type>, '<arg_name>'=>'<arg_type>'] * alternative signature fo...
1
11,154
`short_names` is still optional, so `=` that indicates it has to stay there.
vimeo-psalm
php
@@ -153,6 +153,10 @@ func (agent *ecsAgent) appendFirelensFluentbitCapabilities(capabilities []*ecs.A return appendNameOnlyAttribute(capabilities, attributePrefix+capabilityFirelensFluentbit) } +func (agent *ecsAgent) appendEFSCapabilities(capabilities []*ecs.Attribute) []*ecs.Attribute { + return appendNameOnlyAt...
1
// +build linux // Copyright 2014-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"). You may // not use this file except in compliance with the License. A copy of the // License is located at // // http://aws.amazon.com/apache2.0/ // // o...
1
23,539
missing calling of this method
aws-amazon-ecs-agent
go
@@ -9,10 +9,12 @@ import ( "fmt" "text/template" + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/cloudformation" "github.com/fatih/structs" "gopkg.in/yaml.v3" - "github.com/aws/amazon-ecs-cli-v2/internal/pkg/archer" + archerCfn "github.com/aws/amazon-ecs-cli-v2/internal/pkg/deploy/clo...
1
// Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 package manifest import ( "bytes" "errors" "fmt" "text/template" "github.com/fatih/structs" "gopkg.in/yaml.v3" "github.com/aws/amazon-ecs-cli-v2/internal/pkg/archer" "github.com/aws/amazon-ecs-c...
1
10,714
We could get rid of this dependency being forced on clients by changing the `StackConfiguration` interface abstraction to deal with strings instead of `cloudformation.Parameters` and `cloudformation.Tags`, and internally to the `cloudformation` package translate the input strings into the `service/cloudformation` packa...
aws-copilot-cli
go
@@ -25,6 +25,8 @@ import ( // Stress chaos is a chaos to generate plenty of stresses over a collection of pods. // +kubebuilder:object:root=true +// +kubebuilder:printcolumn:name="action",type=string,JSONPath=`.spec.action` +// +kubebuilder:printcolumn:name="duration",type=string,JSONPath=`.spec.duration` // +chao...
1
// Copyright 2021 Chaos Mesh Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to...
1
25,451
`StressChaos` does not contains a field .spec.action
chaos-mesh-chaos-mesh
go
@@ -1931,7 +1931,12 @@ class FunctionCallTest extends TestCase return $b["a"]; } - a(["a" => "hello"]);', + function b(string $str): string + { + return $str; + } + + ...
1
<?php namespace Psalm\Tests; use Psalm\Config; use Psalm\Context; use Psalm\Tests\Traits\InvalidCodeAnalysisTestTrait; use Psalm\Tests\Traits\ValidCodeAnalysisTestTrait; use const DIRECTORY_SEPARATOR; class FunctionCallTest extends TestCase { use InvalidCodeAnalysisTestTrait; use ValidCodeAnalysisTestTrait; ...
1
12,277
Non-int literal strings are no longer coercible to int, I think this is an improvement. Without this change it now reports `InvalidArgument`.
vimeo-psalm
php
@@ -27,6 +27,8 @@ #include "cast_utils.h" #include "layer_validation_tests.h" +#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) + class MessageIdFilter { public: MessageIdFilter(const char *filter_string) {
1
/* * Copyright (c) 2015-2020 The Khronos Group Inc. * Copyright (c) 2015-2020 Valve Corporation * Copyright (c) 2015-2020 LunarG, Inc. * Copyright (c) 2015-2020 Google, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * Y...
1
13,843
I this used anyplace?
KhronosGroup-Vulkan-ValidationLayers
cpp
@@ -102,7 +102,7 @@ public class TestHiveMetastore { .transportFactory(new TTransportFactory()) .protocolFactory(new TBinaryProtocol.Factory()) .minWorkerThreads(3) - .maxWorkerThreads(5); + .maxWorkerThreads(8); return new TThreadPoolServer(args); }
1
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you ...
1
15,182
Why was this change required?
apache-iceberg
java
@@ -39,6 +39,7 @@ public class AuthorizationException extends ProcessEngineException { protected final String userId; protected final List<MissingAuthorization> missingAuthorizations; + protected final boolean missingAdminRole; // these properties have been replaced by the list of missingAuthorizations ...
1
/* * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH * under one or more contributor license agreements. See the NOTICE file * distributed with this work for additional information regarding copyright * ownership. Camunda licenses this file to you under the Apache License, * Version 2.0; y...
1
12,607
I like that we have this attribute here. However, I think the way we use it right now might be confusing in the future. For example, when only camunda admin is checked, this exception will be instantiated with a message and `missingAdminRole` is `false`. I think that is counter-intuitive. I would expect this exception ...
camunda-camunda-bpm-platform
java
@@ -14,6 +14,9 @@ import com.google.flatbuffers.*; public final class Monster extends Table { public static Monster getRootAsMonster(ByteBuffer _bb) { return getRootAsMonster(_bb, new Monster()); } public static Monster getRootAsMonster(ByteBuffer _bb, Monster obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (o...
1
// automatically generated by the FlatBuffers compiler, do not modify package MyGame.Example; import java.nio.*; import java.lang.*; import java.util.*; import com.google.flatbuffers.*; @SuppressWarnings("unused") /** * an example documentation comment: monster object */ public final class Monster extends Table { ...
1
12,451
Not sure why we're creating a new `ByteBuffer` here, ideally this refers to the existing one?
google-flatbuffers
java
@@ -45,10 +45,11 @@ import getNoDataComponent from '../../../../components/legacy-notifications/noda import getDataErrorComponent from '../../../../components/legacy-notifications/data-error'; import HelpLink from '../../../../components/HelpLink'; import { getCurrentDateRangeDayCount } from '../../../../util/date-r...
1
/** * GoogleSitekitSearchConsoleDashboardWidget component. * * Site Kit by Google, Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apach...
1
35,493
Same here re: `STORE_NAME` to `MODULES_SEARCH_CONSOLE`.
google-site-kit-wp
js
@@ -21,11 +21,14 @@ async function proceedToSetUpAnalytics() { await Promise.all( [ expect( page ).toClick( '.googlesitekit-cta-link', { text: /set up analytics/i } ), page.waitForSelector( '.googlesitekit-setup-module--analytics' ), - page.waitForResponse( ( res ) => res.url().match( 'analytics/data' ) ), + ...
1
/** * WordPress dependencies */ import { activatePlugin, visitAdminPage } from '@wordpress/e2e-test-utils'; /** * Internal dependencies */ import { deactivateUtilityPlugins, resetSiteKit, setAnalyticsExistingPropertyID, setAuthToken, setClientConfig, setSearchConsoleProperty, setSiteVerification, useReques...
1
27,094
I could've sworn I got a `403` myself when I got that response locally. Is `200` what the API would send back for a `permission: false` tag?
google-site-kit-wp
js
@@ -11,13 +11,13 @@ import ( "strings" ) -type identityManager struct { - keystoreManager keystoreInterface +type IdentityManager struct { + KeystoreManager keystoreInterface } -func NewIdentityManager(keydir string) *identityManager { - return &identityManager{ - keystoreManager: keystore.NewKeyStore(keydir, ...
1
// Maps Ethereum account to dto.Identity. // Currently creates a new eth account with password on CreateNewIdentity(). package identity import ( "github.com/ethereum/go-ethereum/accounts/keystore" "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/common" "github.com/mysterium/node/servic...
1
9,668
This attribute was intentionally private. - lets force usage of factory `NewIdentityManager()` - lets ramake to `NewIdentityManager(keydir string)` -> `NewIdentityManager(keystore keystoreManager)`
mysteriumnetwork-node
go
@@ -34,6 +34,10 @@ import ( const transportName = "redis" +const maxConnectRetries = 100 + +var connectRetryDelay = 10 * time.Millisecond + // Inbound is a redis inbound that reads from the given queueKey. This will // wait for an item in the queue or until the timout is reached before trying // to read again.
1
// Copyright (c) 2016 Uber Technologies, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge...
1
11,998
Is this too frequent?
yarpc-yarpc-go
go
@@ -21,6 +21,7 @@ class UploadModel { private const FILE_EXTENSIONS = [ 'csv', + 'zip', ]; /**
1
<?php /** * Copyright © Bold Brand Commerce Sp. z o.o. All rights reserved. * See LICENSE.txt for license details. */ declare(strict_types = 1); namespace Ergonode\Importer\Application\Model\Form; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\Validator\Constraints as Assert; use S...
1
8,926
will this not make it possible to use a zip file, e.g. on other importers who do not have to support it ?
ergonode-backend
php
@@ -34,6 +34,7 @@ from .http import UpstreamConnectLayer from .http1 import Http1Layer from .http2 import Http2Layer from .rawtcp import RawTCPLayer +from .socks_client import SocksClientLayer __all__ = [ "Layer", "ServerConnectionMixin", "Kill",
1
""" In mitmproxy, protocols are implemented as a set of layers, which are composed on top each other. The first layer is usually the proxy mode, e.g. transparent proxy or normal HTTP proxy. Next, various protocol layers are stacked on top of each other - imagine WebSockets on top of an HTTP Upgrade request. An actual m...
1
11,270
Needs to be mentioned in `__all__` below.
mitmproxy-mitmproxy
py
@@ -349,6 +349,13 @@ signalfd_thread_exit(dcontext_t *dcontext, thread_sig_info_t *info) TABLE_RWLOCK(sigfd_table, write, unlock); } +bool +is_repeat_handle_pre_extended_syscall_sigmasks(dcontext_t *dcontext) +{ + thread_sig_info_t *info = (thread_sig_info_t *)dcontext->signal_field; + return info->pre_sy...
1
/* ********************************************************** * Copyright (c) 2011-2018 Google, Inc. All rights reserved. * Copyright (c) 2000-2010 VMware, Inc. All rights reserved. * **********************************************************/ /* * Redistribution and use in source and binary forms, with or witho...
1
15,327
What if the app's signal handler, executed at pre-syscall for epoll_pwait, executes its own epoll_pwait? For that matter: what happens natively if that happens? I would not expect the kernel to keep a stack -- does that clobber the kernel's stored pre-syscall mask?
DynamoRIO-dynamorio
c
@@ -139,8 +139,10 @@ public interface DataFile { DataFile copy(); /** - * @return a list of offsets for file blocks if applicable, null otherwise. When available, this - * information is used for planning scan tasks whose boundaries are determined by these offsets. + * @return List of offsets for blocks o...
1
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you ...
1
13,463
Nit: missing a space. I think we should phrase the new content a little differently. "It is important" isn't very clear. I think it should be "offsets will be returned in sorted order."
apache-iceberg
java
@@ -10,8 +10,10 @@ import ( "crypto/md5" "encoding/base64" "encoding/hex" + "encoding/json" "fmt" "io" + "io/ioutil" "net/http" "net/url" "path"
1
// Package azureblob provides an interface to the Microsoft Azure blob object storage system // +build !plan9,!solaris,!js,go1.13 package azureblob import ( "bytes" "context" "crypto/md5" "encoding/base64" "encoding/hex" "fmt" "io" "net/http" "net/url" "path" "strings" "sync" "time" "github.com/Azure/...
1
12,570
Can you remove this blank line and put the added import in sorted order (likely your editor will do this)
rclone-rclone
go
@@ -606,12 +606,16 @@ static int listener_setup_ssl(h2o_configurator_command_t *cmd, h2o_configurator_ : "share/h2o/fetch-ocsp-response"; if (ocsp_update_interval != 0) { switch (conf.run_mode) { - case RUN_MODE_WORKER: + ...
1
/* * Copyright (c) 2014,2015 DeNA Co., Ltd., Kazuho Oku, Tatsuhiko Kubo, * Domingo Alvarez Duarte, Nick Desaulniers, * Jeff Marison * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files...
1
10,649
Even if `pthread_create()` for `ocsp_updater_thread()` fails, `h2o` can continue to serve. But I'm a little worried whether `h2o` should continue to serve in this case. How about you?
h2o-h2o
c
@@ -37,6 +37,15 @@ import { __, _x, sprintf } from '@wordpress/i18n'; import { Component, Fragment } from '@wordpress/element'; import { addFilter, removeFilter } from '@wordpress/hooks'; +/** + * Internal dependencies + */ +import { isValidAccountID, isValidContainerID } from './util'; + +const ACCOUNT_CREATE = 'a...
1
/** * TagmanagerSetup component. * * Site Kit by Google, Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0...
1
26,177
I like introduction of these constants for account/container creation, but the `ACCOUNT_CHOOSE` one isn't needed I think. This should instead be an "empty" value (either `''` or `0`), to indicate more clearly that this field is not filled. It should be the same for choosing a container.
google-site-kit-wp
js
@@ -101,3 +101,16 @@ Blockly.scratchBlocksUtils.isShadowArgumentReporter = function(block) { return (block.isShadow() && (block.type == 'argument_reporter_boolean' || block.type == 'argument_reporter_string_number')); }; + +/** + * Compare strings with natural number sorting. + * @param {string} str1 First i...
1
/** * @license * Visual Blocks Editor * * Copyright 2018 Google Inc. * https://developers.google.com/blockly/ * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apach...
1
9,414
I noticed that passing in `[]` for the locales argument instead of 'undefined' seems to have the same effect. I think that's preferred over passing in `undefined` as a value, and unfortunately passing in `null` seems to throw an error.
LLK-scratch-blocks
js
@@ -114,12 +114,11 @@ func getEngine() (*xorm.Engine, error) { } case "postgres": host, port := "127.0.0.1", "5432" - fields := strings.Split(DbCfg.Host, ":") - if len(fields) > 0 && len(strings.TrimSpace(fields[0])) > 0 { - host = fields[0] - } - if len(fields) > 1 && len(strings.TrimSpace(fields[1])) > ...
1
// Copyright 2014 The Gogs Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. package models import ( "database/sql" "errors" "fmt" "net/url" "os" "path" "strings" _ "github.com/go-sql-driver/mysql" "github.com/go-xorm/core" ...
1
11,785
1. `0` is redundant. 2. We should save result of `strings.LastIndex(DbCfg.Host, ":")` to a variable and reuse.
gogs-gogs
go
@@ -157,6 +157,7 @@ type Options struct { NoLog bool `json:"-"` NoSigs bool `json:"-"` NoSublistCache bool `json:"-"` + NoHeaderSupport bool `json:"-"` DisableShortFirstPing bool `json:"-"` Logtime bool ...
1
// Copyright 2012-2020 The NATS Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to ...
1
10,422
Do you envision "new" servers not supporting header, or is it more a way to test mix of old and new? If so, we could make it a "private" (non exported) option.
nats-io-nats-server
go
@@ -51,7 +51,7 @@ type Connection struct { func (c *Connection) Start(options connection.ConnectOptions) (err error) { var config wg.ServiceConfig if err := json.Unmarshal(options.SessionConfig, &config); err != nil { - return err + return errors.Wrap(err, "failed to unmarshal connection config") } c.config....
1
/* * Copyright (C) 2018 The "MysteriumNetwork/node" Authors. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * ...
1
13,222
For future reference. Try not to do refactoring in the same PR which solves some bug or implements some feature. Not to clutter reading. Do it in separate PR.
mysteriumnetwork-node
go
@@ -110,7 +110,7 @@ func init() { addTxnFlags(freezeAssetCmd) infoAssetCmd.Flags().Uint64Var(&assetID, "assetid", 0, "ID of the asset to look up") - infoAssetCmd.Flags().StringVar(&assetUnitName, "asset", "", "Unit name of the asset to look up") + infoAssetCmd.Flags().StringVar(&assetUnitName, "unit", "", "Unit n...
1
// Copyright (C) 2019-2020 Algorand, Inc. // This file is part of go-algorand // // go-algorand is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as // published by the Free Software Foundation, either version 3 of the // License, or (at your option) ...
1
40,111
I'm not sure about changing the flag name. unit is more accurate, but for I think for most people asset is also a fine name to use.
algorand-go-algorand
go
@@ -0,0 +1,19 @@ +// +build windows + +package terminal + +import ( + "syscall" +) + +// HideConsole hides the console window and activates another window +func HideConsole() { + getConsoleWindow := syscall.NewLazyDLL("kernel32.dll").NewProc("GetConsoleWindow") + showWindow := syscall.NewLazyDLL("user32.dll").NewProc("...
1
1
12,763
Which windows gets activated? A random other window?
rclone-rclone
go
@@ -62,6 +62,11 @@ func (a *Publisher) Start(ctx context.Context) error { } func (a *Publisher) receive(ctx context.Context, event cloudevents.Event, resp *cloudevents.EventResponse) error { + // Upgrade to supported transport version. + if event.SpecVersion() != cloudevents.VersionV03 { + event.Context = event.Co...
1
/* Copyright 2019 Google LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software dist...
1
9,318
Just to make sure, this is totally lossless? If I put a v2 there, then it gets upgraded to v3, but my function expects v2, then this is fine and nothing is lost?
google-knative-gcp
go
@@ -228,4 +228,10 @@ public class TableProperties { public static final String MERGE_CARDINALITY_CHECK_ENABLED = "write.merge.cardinality-check.enabled"; public static final boolean MERGE_CARDINALITY_CHECK_ENABLED_DEFAULT = true; + + public static final String WATERMARK_FIELD_NAME = "write.watermark.field"; + ...
1
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you ...
1
42,052
In the past, we have 3 Flink streaming jobs (1 for each AWS region) writing to the same table. We need to write to 3 different watermark table properties (1 for each region). Watermark consumer then use the min value to determine the overall table watermark. A provider pattern similar to `WRITE_LOCATION_PROVIDER_IMPL` ...
apache-iceberg
java
@@ -67,6 +67,16 @@ func (h TlfHandle) IsReader(user keybase1.UID) bool { return ok } +// ResolvedReadersMap returns a map of resolved readers from uid to usernames. +func (h TlfHandle) ResolvedReadersMap() map[keybase1.UID]libkb.NormalizedUsername { + return h.resolvedReaders +} + +// ResolvedWritersMap returns a ...
1
// Copyright 2016 Keybase Inc. All rights reserved. // Use of this source code is governed by a BSD // license that can be found in the LICENSE file. package libkbfs // This file has the type for TlfHandles and offline functionality. import ( "errors" "fmt" "reflect" "sort" "strings" "github.com/keybase/clien...
1
16,082
Can you change this to `ResolvedUsersMap` and build a new map with both readers/writers? That way, we get the nice side effect of not exposing the internal map of the handle, and simplifying the callers a bit.
keybase-kbfs
go
@@ -439,10 +439,12 @@ function createTopology(mongoClient, topologyType, options, callback) { } const MongoClient = loadClient(); - const connectionString = - os.platform() === 'win32' - ? 'mongodb://localhost:27020/?serverSelectionTimeoutMS=1000' - : 'mongodb://%2Ftmp%2Fmongocryptd.so...
1
'use strict'; const deprecate = require('util').deprecate; const Logger = require('../core').Logger; const MongoError = require('../core').MongoError; const Mongos = require('../topologies/mongos'); const parse = require('../core').parseConnectionString; const ReadPreference = require('../core').ReadPreference; const ...
1
15,912
I typically try to avoid nested ternary expressions. Can we rewrite this as if statements? Worst case, can we break it out into its own function?
mongodb-node-mongodb-native
js
@@ -427,7 +427,8 @@ if __name__ == "__main__": # pragma: no cover tls_start.ssl_conn.set_accept_state() else: tls_start.ssl_conn.set_connect_state() - tls_start.ssl_conn.set_tlsext_host_name(tls_start.context.client.sni) + if tls_start.contex...
1
""" Proxy Server Implementation using asyncio. The very high level overview is as follows: - Spawn one coroutine per client connection and create a reverse proxy layer to example.com - Process any commands from layer (such as opening a server connection) - Wait for any IO and send it as events to top layer...
1
15,350
Do we still support handshakes without SNI present?
mitmproxy-mitmproxy
py
@@ -131,7 +131,7 @@ module Substitutors when :post_replacements text = sub_post_replacements text else - warn %(asciidoctor: WARNING: unknown substitution type #{type}) + logger.warn %(unknown substitution type #{type}) end end text = restore_passthroughs text if ha...
1
# encoding: UTF-8 module Asciidoctor # Public: Methods to perform substitutions on lines of AsciiDoc text. This module # is intented to be mixed-in to Section and Block to provide operations for performing # the necessary substitutions. module Substitutors SpecialCharsRx = /[<&>]/ SpecialCharsTr = { '>' => '&gt;', ...
1
5,818
Maybe it's because I work too much on a centralized logging system but it could be great to add a "category" like "attribute", "substitution", "include directive", "macro", "extension"...
asciidoctor-asciidoctor
rb
@@ -45,7 +45,7 @@ def normalizeName(name): """Normalize the class name to remove ambiguity This function removes the white spaces in the name, and also - remove the pointer declaration "*" (it have no sense in python) """ + remove the pointer declaration "*" (it have no sense in python)""" name...
1
# ========================================================================== # # Copyright NumFOCUS # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/...
1
13,962
it have no sense in python -> it makes no sense in python
InsightSoftwareConsortium-ITK
cpp
@@ -29,11 +29,13 @@ import ( type Pool struct { start, capacity int rand *rand.Rand + openvpnPort int } // ServicePortSupplier provides port needed to run a service on type ServicePortSupplier interface { Acquire() (Port, error) + OpenvpnPort() (Port, error) } // NewPool creates a port po...
1
/* * Copyright (C) 2019 The "MysteriumNetwork/node" Authors. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * ...
1
14,272
maybe just do a separate implementation of the pool for openvpn case? It's a bit confusing having two methods here.
mysteriumnetwork-node
go
@@ -413,7 +413,7 @@ function createTopology(mongoClient, topologyType, options, callback) { // Open the connection topology.connect(options, (err, newTopology) => { if (err) { - topology.close(true); + if (topology) topology.close(); return callback(err); }
1
'use strict'; const authenticate = require('../authenticate'); const deprecate = require('util').deprecate; const Logger = require('mongodb-core').Logger; const MongoError = require('mongodb-core').MongoError; const Mongos = require('../topologies/mongos'); const parse = require('mongodb-core').parseConnectionString; ...
1
15,085
how is it possible to have a `topology` that is falsey when we had to call `topology.connect` in order to get here?
mongodb-node-mongodb-native
js
@@ -0,0 +1,13 @@ +require 'spec_helper' + +describe Widgets::PlanChurnsController do + it 'returns the current churn for the requested plan' do + plan = stub(current_churn: 10) + PlanFinder.stubs(where: [plan]) + + get :show, format: :json, sku: 'sku' + + expect(PlanFinder).to have_received(:where).with(sk...
1
1
8,631
Do we need this expectation? If we don't call this method on `PlanFinder` there's no way for the `10` to be returned. Seems somewhat redundant. What do you think?
thoughtbot-upcase
rb
@@ -141,8 +141,6 @@ func NewMinEdgeSiteConfig() *EdgeSiteConfig { APIVersion: path.Join(GroupName, APIVersion), }, DataBase: &edgecoreconfig.DataBase{ - DriverName: DataBaseDriverName, - AliasName: DataBaseAliasName, DataSource: DataBaseDataSource, }, KubeAPIConfig: &cloudcoreconfig.KubeAPIConf...
1
/* Copyright 2019 The KubeEdge Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, sof...
1
15,476
We need to do the same for edgecore
kubeedge-kubeedge
go
@@ -378,8 +378,15 @@ namespace TestPlatform.CommunicationUtilities.UnitTests this.mockDataSerializer.Setup(ds => ds.DeserializeMessage(rawMessage)).Returns(message); this.mockDataSerializer.Setup(ds => ds.DeserializePayload<TestRunCompletePayload>(message)).Returns(payload); + var...
1
// Copyright (c) Microsoft. All rights reserved. namespace TestPlatform.CommunicationUtilities.UnitTests { using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.Threading; using Microsoft.VisualStudio.TestPlatform.CommunicationUtilities...
1
11,081
This fix has nothing to do with the product change. Just a fix I am making for the test issue.
microsoft-vstest
.cs
@@ -94,8 +94,7 @@ namespace OpenTelemetry.Trace } else if (this.Exporter != null) { - // TODO: Make this BatchingActivityProcessor once its available. - exportingProcessor = new SimpleActivityProcessor(this.Exporter); + exportingProcess...
1
// <copyright file="ActivityProcessorPipelineBuilder.cs" company="OpenTelemetry Authors"> // Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // ...
1
15,236
Don't know what should be the default. Lets keep BatchingProcessor for now. And revisit the area after beta.
open-telemetry-opentelemetry-dotnet
.cs
@@ -1,4 +1,4 @@ -require 'rspec/support/reentrant_mutex' +RSpec::Support.require_rspec_support 'reentrant_mutex' module RSpec module Core
1
require 'rspec/support/reentrant_mutex' module RSpec module Core # This module is included in {ExampleGroup}, making the methods # available to be called from within example blocks. # # @see ClassMethods module MemoizedHelpers # @note `subject` was contributed by Joe Ferris to support the o...
1
15,588
Ah that's how it's happening, it's probably using the `require_relative` in the optimised one and that counts as a different require to the bare one.
rspec-rspec-core
rb
@@ -27,6 +27,7 @@ namespace MvvmCross.Platforms.Ios.Binding.Views : base(tableView) { _cellIdentifier = new NSString(cellIdentifier); + tableView.RegisterNibForCellReuse(UINib.FromName(cellIdentifier, NSBundle.MainBundle), cellIdentifier); } public MvxSi...
1
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MS-PL license. // See the LICENSE file in the project root for more information. using System; using Foundation; using MvvmCross.Logging; using MvvmCross.Platforms.Ios; using UIKit; namespace M...
1
14,779
What happens if there is no NIB/XIB with that name?
MvvmCross-MvvmCross
.cs
@@ -79,7 +79,7 @@ type Server struct { ap actpool.ActPool gs *gasstation.GasStation broadcastHandler BroadcastOutbound - cfg config.API + cfg config.Config registry *protocol.Registry blockListener *blockListener grpcserver *grpc.Server
1
// Copyright (c) 2019 IoTeX // This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no // warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent // permitted by law, all liability for your use of the cod...
1
18,199
this is not necessary?
iotexproject-iotex-core
go
@@ -19,6 +19,7 @@ import ( "github.com/aws/amazon-ecs-agent/agent/taskresource" asmauthres "github.com/aws/amazon-ecs-agent/agent/taskresource/asmauth" + asmsecretres "github.com/aws/amazon-ecs-agent/agent/taskresource/asmsecret" cgroupres "github.com/aws/amazon-ecs-agent/agent/taskresource/cgroup" ssmsecretr...
1
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"). You may // not use this file except in compliance with the License. A copy of the // License is located at // // http://aws.amazon.com/apache2.0/ // // or in the "license" fil...
1
21,333
typo: `asmsecrets "github...`
aws-amazon-ecs-agent
go
@@ -269,14 +269,14 @@ function neve_sanitize_meta_ordering( $value ) { ); if ( empty( $value ) ) { - return $allowed; + return wp_json_encode( $allowed ); } $decoded = json_decode( $value, true ); foreach ( $decoded as $val ) { if ( ! in_array( $val, $allowed, true ) ) { - return $allowed; + re...
1
<?php /** * * Sanitize functions. * * Author: Andrei Baicus <andrei@themeisle.com> * Created on: 20/08/2018 * * @package Neve\Globals */ /** * Function to sanitize alpha color. * * @param string $value Hex or RGBA color. * * @return string */ function neve_sanitize_colors( $value ) { $is_v...
1
21,917
I think that the JSON encoding should be handled by the control itself, not the sanitization function. This should only confirm that the input is correct, not reformat it
Codeinwp-neve
php
@@ -79,6 +79,12 @@ func (i *Inbound) SetRegistry(registry transport.Registry) { i.registry = registry } +// Transports returns the inbound's HTTP transport. +func (i *Inbound) Transports() []transport.Transport { + // TODO factor out transport and return it here. + return []transport.Transport{} +} + // Start sta...
1
// Copyright (c) 2016 Uber Technologies, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge...
1
11,567
Should we put a TODO here to route the http.Transport through here?
yarpc-yarpc-go
go
@@ -177,7 +177,7 @@ func RemoveManagementInterface(networkName string) error { var err error var maxRetry = 3 var i = 0 - cmd := fmt.Sprintf("Get-VMSwitch -Name %s | Set-VMSwitch -AllowManagementOS $false ", networkName) + cmd := fmt.Sprintf("Get-VMSwitch -ComputerName $(hostname) -Name %s | Set-VMSwitch -Compu...
1
//go:build windows // +build windows //Copyright 2020 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless req...
1
50,548
Sorry, could you explain more about the issue? Doesn't ComputerName already default to local computer? > -ComputerName Specifies one or more Hyper-V hosts on which the virtual switch is to be configured. NetBIOS names, IP addresses, and fully qualified domain names are allowable. The default is the local computer. Use ...
antrea-io-antrea
go
@@ -131,9 +131,13 @@ func runCliTool(logger *log.Logger, testCase *junitxml.TestCase, cmdString strin } // RunTestCommand runs given test command -func RunTestCommand(cmd string, args []string, logger *log.Logger, testCase *junitxml.TestCase) bool { +func RunTestCommand(cmd string, args []string, logger *log.Logger...
1
// Copyright 2020 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by appl...
1
11,536
`allowError` is a big vague. Does this mean the test case is asserting that an error should occur? If it means "maybe an error can occur, and that's okay" -- what's an example of this?
GoogleCloudPlatform-compute-image-tools
go
@@ -29,7 +29,11 @@ var Xrc20Cmd = &cobra.Command{ var xrc20ContractAddress string func xrc20Contract() (address.Address, error) { - return alias.IOAddress(xrc20ContractAddress) + addr, err := alias.IOAddress(xrc20ContractAddress) + if err != nil { + return nil, output.NewError(output.FlagError, "invalid xrc20 addr...
1
// Copyright (c) 2019 IoTeX Foundation // This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no // warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent // permitted by law, all liability for your use...
1
19,300
return statements should not be cuddled if block has more than two lines (from `wsl`)
iotexproject-iotex-core
go
@@ -10,11 +10,12 @@ import java.util.*; import java.util.concurrent.TimeUnit; import static java.lang.management.ManagementFactory.*; +import sun.reflect.generics.reflectiveObjects.NotImplementedException; /** * A collection of Java Virtual Machine metrics. */ -public class VirtualMachineMetrics { +public cl...
1
package com.yammer.metrics.core; import java.io.IOException; import java.io.OutputStream; import java.io.PrintWriter; import java.lang.Thread.State; import java.lang.management.*; import java.lang.reflect.Method; import java.util.*; import java.util.concurrent.TimeUnit; import static java.lang.management.ManagementFa...
1
5,406
Why does VirtualMachineMetrics have to implement Metric?
dropwizard-metrics
java
@@ -64,16 +64,12 @@ func TestSingleAccountManager_SignVote(t *testing.T) { require.NoError(err) voteeAddress, err := iotxaddress.GetAddressByPubkey(iotxaddress.IsTestnet, iotxaddress.ChainID, votePubKey) require.NoError(err) - rawVote, err := action.NewVote(uint64(1), voterAddress.RawAddress, voteeAddress.RawAddr...
1
// Copyright (c) 2018 IoTeX // This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no // warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent // permitted by law, all liability for your use of the cod...
1
11,956
line is 121 characters
iotexproject-iotex-core
go
@@ -93,7 +93,7 @@ function setProperty(dom, name, value, oldValue, isSvg) { } } // Benchmark for comparison: https://esbench.com/bench/574c954bdb965b9a00965ac6 - else if (name[0] === 'o' && name[1] === 'n') { + else if (name.slice(0, 2) === 'on') { let useCapture = name !== (name = name.replace(/Capture$/, ''...
1
import { IS_NON_DIMENSIONAL } from '../constants'; import options from '../options'; /** * Diff the old and new properties of a VNode and apply changes to the DOM node * @param {import('../internal').PreactElement} dom The DOM node to apply * changes to * @param {object} newProps The new props * @param {object} o...
1
15,182
How's that linked esbench looking with slice?
preactjs-preact
js
@@ -131,14 +131,11 @@ class RemoteFileSystem(luigi.target.FileSystem): return exists def _ftp_exists(self, path, mtime): - path_parts = path.split('/') - path = '/'.join(path_parts[:-1]) - fn = path_parts[-1] - - files = self.conn.nlst(path) + dirname = os.path.dirname...
1
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
1
15,092
The split and join was probably done to ensure that this still works on Windows because os.path.dirname works differently depending on the os you're running under :(. It would probably be a little better to do `dirname, _, fn = path.rpartition('/')` if you want something cleaner than the split/join.
spotify-luigi
py
@@ -81,6 +81,10 @@ public abstract class SessionMap implements HasReadyState, Routable { public abstract void remove(SessionId id); + public int getCount() { + return -10; + }; + public URI getUri(SessionId id) throws NoSuchSessionException { return get(id).getUri(); }
1
// Licensed to the Software Freedom Conservancy (SFC) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The SFC licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you m...
1
17,774
This is not the right approach. The `Distributor` maintains a model of the current state of the Grid. That model already contains the information about every active session. We don't need to modify `SessionMap` to expose it further.
SeleniumHQ-selenium
py
@@ -335,6 +335,9 @@ func (s *session) run() error { var closeErr closeError handshakeEvent := s.handshakeEvent + var pacingDeadline time.Time + + s.maybeResetTimer(time.Time{}) runLoop: for {
1
package quic import ( "context" "crypto/tls" "errors" "net" "sync" "time" "github.com/lucas-clemente/quic-go/ackhandler" "github.com/lucas-clemente/quic-go/congestion" "github.com/lucas-clemente/quic-go/internal/crypto" "github.com/lucas-clemente/quic-go/internal/flowcontrol" "github.com/lucas-clemente/qui...
1
7,223
Can you make this a member var as all the other deadlines? Then you can drop the param to resetTimer() and simplify some of the code below iiuc.
lucas-clemente-quic-go
go