hash
stringlengths
40
40
diff
stringlengths
131
26.7k
message
stringlengths
7
694
project
stringlengths
5
67
split
stringclasses
1 value
diff_languages
stringlengths
2
24
d7bb69397eed4ace1a310c14f39d51c1b64f3b31
diff --git a/src/main/java/net/browsertime/tool/timings/TimingRun.java b/src/main/java/net/browsertime/tool/timings/TimingRun.java index <HASH>..<HASH> 100644 --- a/src/main/java/net/browsertime/tool/timings/TimingRun.java +++ b/src/main/java/net/browsertime/tool/timings/TimingRun.java @@ -69,8 +69,8 @@ public class TimingRun { resourceMeasurements.add(measurement); } - @XmlElementWrapper(name = "resourceMeasurements") - @XmlElement(name = "measurement") + @XmlElementWrapper(name = "resources") + @XmlElement(name = "resource") public List<TimingResourceMeasurement> getResourceMeasurements() { Collections.sort(resourceMeasurements); // sort in time order return Collections.unmodifiableList(resourceMeasurements);
Rename xml elements for resource timings. New xml structure is <resources><resource ...>. This is easier to read, and avoids the confusion of having to elements with same name, but different set of attributes.
sitespeedio_browsertime
train
java
5c0974c6bf1d8172c3a20d35d587e432ec52b28b
diff --git a/pkg/endpoint/policy.go b/pkg/endpoint/policy.go index <HASH>..<HASH> 100644 --- a/pkg/endpoint/policy.go +++ b/pkg/endpoint/policy.go @@ -253,7 +253,11 @@ func (e *Endpoint) regenerate(owner Owner, context *regenerationContext) (retErr logfields.Reason: context.Reason, }).Debug("Regenerating endpoint") - defer e.updateRegenerationStatistics(context, retErr) + defer func() { + // This has to be within a func(), not deferred directly, so that the + // value of retErr is passed in from when regenerate returns. + e.updateRegenerationStatistics(context, retErr) + }() e.BuildMutex.Lock() defer e.BuildMutex.Unlock()
endpoint: make sure `updateRegenerationStatistics` is called within anonymous function This ensures that the value of `retErr` that is passed into the function is the value after `regenerate` returns, not the value at the time the function was deferred, in which case it would be nil. An example of this behavior when deferred directly: <URL>. And when wrapped in an anonymous function: <URL>.
cilium_cilium
train
go
e429ecc227c4e5d4db27e9ce5a49971e3010f230
diff --git a/lib/arel/visitors/sqlserver.rb b/lib/arel/visitors/sqlserver.rb index <HASH>..<HASH> 100644 --- a/lib/arel/visitors/sqlserver.rb +++ b/lib/arel/visitors/sqlserver.rb @@ -115,6 +115,13 @@ module Arel end def visit_Make_Fetch_Happen o, collector + if o.limit + value = case o.limit.expr + when Numeric then o.limit.expr + when Arel::Nodes::Unary then o.limit.expr.expr + end + o.limit = nil if value == 0 + end o.offset = Nodes::Offset.new(0) if o.limit && !o.offset collector = visit o.offset, collector if o.offset collector = visit o.limit, collector if o.limit
The number of rows provided for a FETCH clause must be greater then zero <I> failures, <I> errors, 2 skips
rails-sqlserver_activerecord-sqlserver-adapter
train
rb
5e72eb6aa2447ad57e3763652b477d6e517c77df
diff --git a/lib/rspreedly/subscriber.rb b/lib/rspreedly/subscriber.rb index <HASH>..<HASH> 100644 --- a/lib/rspreedly/subscriber.rb +++ b/lib/rspreedly/subscriber.rb @@ -105,7 +105,7 @@ module RSpreedly # Update a Subscriber (more) # PUT /api/v4/[short site name]/subscribers/[subscriber id].xml def update! - !! api_request(:put, "/subscribers/#{self.customer_id}.xml", :body => self.to_xml(:exclude => [:customer_id, :invoices])) + !! api_request(:put, "/subscribers/#{self.customer_id}.xml", :body => self.to_xml(:exclude => [:customer_id])) end def update @@ -193,7 +193,8 @@ module RSpreedly :grace_until, :in_grace_period, :lifetime_subscription, :on_trial, :ready_to_renew, :recurring, :store_credit, :store_credit_currency_code, :subscription_plan_name, - :token, :updated_at, :ready_to_renew_since + :token, :updated_at, :ready_to_renew_since, + :invoices ] opts[:exclude] ||= []
should ignore invoices globally when serializing subscribers, since it's used in creating/saving other stuff including invoices from scratch
rlivsey_rspreedly
train
rb
e2fe1dd5a97bd7420c7d964c57fda975f7e6d1b6
diff --git a/.storybook/elements/ToggleStory.js b/.storybook/elements/ToggleStory.js index <HASH>..<HASH> 100644 --- a/.storybook/elements/ToggleStory.js +++ b/.storybook/elements/ToggleStory.js @@ -22,7 +22,7 @@ storiesOf('Toggle', module) </AppContainer> )) .add('toggle', () => ( - <Toggle {...toggleEvents} className="some-class"></Toggle> + <Toggle {...toggleEvents} className="some-class" id="toggle-1"></Toggle> )) .add('disabled', () => ( <Toggle {...toggleEvents} disabled={true}></Toggle> diff --git a/elements/Toggle.js b/elements/Toggle.js index <HASH>..<HASH> 100644 --- a/elements/Toggle.js +++ b/elements/Toggle.js @@ -26,7 +26,6 @@ class Toggle extends React.Component { static defaultProps = { className: 'bx--toggle', - id: 'toggle-1', tabIndex: 0, onBlur: () => {}, onClick: () => {},
Removed id as default prop
carbon-design-system_carbon-components-react
train
js,js
22b9d478976d932b129d56227e645425823b6c26
diff --git a/bin/clock.js b/bin/clock.js index <HASH>..<HASH> 100644 --- a/bin/clock.js +++ b/bin/clock.js @@ -1,3 +1,4 @@ +#!/usr/bin/env node var FlipDot = require('../flipdot.js'); var dateFormat = require('dateformat'); var args = require('args') diff --git a/bin/term.js b/bin/term.js index <HASH>..<HASH> 100644 --- a/bin/term.js +++ b/bin/term.js @@ -1,3 +1,4 @@ +#!/usr/bin/env node var FlipDot = require('../flipdot.js') var args = require('args') @@ -33,4 +34,4 @@ flippy.once('free', () => { console.log("Written!") flippy.close(); process.exit(0); -}) \ No newline at end of file +})
Add shebang lines to make CLI tools runnable Without these your shell will attempt to run the node code as shell script and fail. This allows you to run `flipdot` and `flipdot-clock` without having to specify that they should be run under node.
tuna-f1sh_node-flipdot
train
js,js
24ba23ea60f3e951d4d040bee1b6469ec6172309
diff --git a/lib/generator.js b/lib/generator.js index <HASH>..<HASH> 100644 --- a/lib/generator.js +++ b/lib/generator.js @@ -348,7 +348,7 @@ function generateDoc(source, options) { docMarkdown.push('<!-- /div -->\n'); // Add link back to the top of the TOC. - var tocLink = _.result(options, 'tocLink', '#' + tocGroups[0].toLowerCase()); + var tocLink = _.result(options, 'tocLink', '#' + _.result(tocGroups, 0, '').toLowerCase()); docMarkdown.push(' [1]: ' + tocLink + ' "Jump back to the TOC."\n'); return docMarkdown.join('\n');
Guard against empty `tocGroups`.
jdalton_docdown
train
js
384ae6651e490d7366929aebf848aa5567da656c
diff --git a/py2cytoscape/data/style.py b/py2cytoscape/data/style.py index <HASH>..<HASH> 100644 --- a/py2cytoscape/data/style.py +++ b/py2cytoscape/data/style.py @@ -109,19 +109,19 @@ class Style(object): vals = {entry['visualProperty']: entry['value'] for entry in result} return pd.Series(vals) - def update_defaults(self, key_value_dict): + def update_defaults(self, prop_value_dict): """ Updates the value of one or more visual properties. - :param key_value_dict: Dictionary containing, for each visual property, + :param prop_value_dict: Dictionary containing, for each visual property, the new value to use. """ body = [] - for key in key_value_dict: + for key in prop_value_dict: entry = { 'visualProperty': key, - 'value': key_value_dict[key] + 'value': prop_value_dict[key] } body.append(entry)
Merge branch 'style-update' into develop
cytoscape_py2cytoscape
train
py
6c836f94bda16ef7ab60a4daf05ea0dc34ebdbe2
diff --git a/src/Codeception/TestCase/WPTestCase.php b/src/Codeception/TestCase/WPTestCase.php index <HASH>..<HASH> 100644 --- a/src/Codeception/TestCase/WPTestCase.php +++ b/src/Codeception/TestCase/WPTestCase.php @@ -220,6 +220,10 @@ class WPTestCase extends \Codeception\Test\Unit { function files_in_dir($dir) { $files = array(); + if (!file_exists($dir)) { + return array(); + } + $iterator = new \RecursiveDirectoryIterator($dir); $objects = new \RecursiveIteratorIterator($iterator); foreach ($objects as $name => $object) {
avoid scanning the folder if it does not exist
lucatume_wp-browser
train
php
a866c39ec3cd69301ea2197c1048bc65b63502db
diff --git a/modules/system/classes/PluginManager.php b/modules/system/classes/PluginManager.php index <HASH>..<HASH> 100644 --- a/modules/system/classes/PluginManager.php +++ b/modules/system/classes/PluginManager.php @@ -299,6 +299,7 @@ class PluginManager $dirPath = $this->getPath(); $it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dirPath)); $it->setMaxDepth(2); + $it->rewind(); while($it->valid()) { if (($it->getDepth() > 1) && $it->isFile() && (strtolower($it->getFilename()) == "plugin.php")) { diff --git a/tests/unit/cms/classes/ThemeTest.php b/tests/unit/cms/classes/ThemeTest.php index <HASH>..<HASH> 100644 --- a/tests/unit/cms/classes/ThemeTest.php +++ b/tests/unit/cms/classes/ThemeTest.php @@ -15,6 +15,7 @@ class ThemeTest extends TestCase $result = 0; $it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path)); $it->setMaxDepth(1); + $it->rewind(); while($it->valid()) { if (!$it->isDot() && !$it->isDir() && $it->getExtension() == 'htm')
Fixes #<I> manually (unable to merge)
octobercms_october
train
php,php
9c93481ea94529dc2015317009137b8f3480a261
diff --git a/master/buildbot/test/expect.py b/master/buildbot/test/expect.py index <HASH>..<HASH> 100644 --- a/master/buildbot/test/expect.py +++ b/master/buildbot/test/expect.py @@ -84,10 +84,6 @@ class Expect: return self def log(self, name, **streams): - if name == 'stdio' and 'stdout' in streams: - raise NotImplementedError() - if name == 'stdio' and 'sterr' in streams: - raise NotImplementedError() self.behaviors.append(('log', name, streams)) return self
test: Allow stdio logs in command expectations again This was used to verify all our own tests use stdout and stderr. This is no longer needed.
buildbot_buildbot
train
py
f3bcd29e06cc039b9da450c8c7de761907bb94e2
diff --git a/src/Application.php b/src/Application.php index <HASH>..<HASH> 100644 --- a/src/Application.php +++ b/src/Application.php @@ -50,8 +50,9 @@ class Application { foreach ($this->routes as $route) { $matches = $route->matches($request, $this); - if ($matches) + if ($matches) { $result[] = array($route, $matches); + } } return $result; }
Coding style tweak on the Application class.
vanilla_garden
train
php
7d6dcf92e0bda5f04f3916d8f30432307c0cb963
diff --git a/lib/xero_gateway/line_item.rb b/lib/xero_gateway/line_item.rb index <HASH>..<HASH> 100644 --- a/lib/xero_gateway/line_item.rb +++ b/lib/xero_gateway/line_item.rb @@ -22,7 +22,7 @@ module XeroGateway b.TaxType tax_type if tax_type b.TaxAmount LineItem.format_money(tax_amount) if tax_amount b.LineAmount LineItem.format_money(line_amount) - b.AccountCode account_code || 200 + b.AccountCode account_code if account_code b.Tracking { b.TrackingCategory { b.Name tracking_category
only set the account code if one is provided (don't default to <I>)
xero-gateway_xero_gateway
train
rb
b0a1af1163c7c3a53bc79389ae0936652ddc8930
diff --git a/client/protege/src/main/java/it/unibz/inf/ontop/protege/core/OBDAModel.java b/client/protege/src/main/java/it/unibz/inf/ontop/protege/core/OBDAModel.java index <HASH>..<HASH> 100644 --- a/client/protege/src/main/java/it/unibz/inf/ontop/protege/core/OBDAModel.java +++ b/client/protege/src/main/java/it/unibz/inf/ontop/protege/core/OBDAModel.java @@ -367,7 +367,7 @@ public class OBDAModel { public void updateMappingId(String formerMappingId, String newMappingId) throws DuplicateMappingException { //if the id are the same no need to update the mapping - if(formerMappingId != newMappingId) { + if(!formerMappingId.equals(newMappingId)) { SQLPPTriplesMap formerTriplesMap = getTriplesMap(formerMappingId); if (formerTriplesMap != null) {
do not update id for mapping with the same id
ontop_ontop
train
java
482fa566c56a8f02f66a577836b683fad8abd404
diff --git a/examples/catalogs/bundles/views.py b/examples/catalogs/bundles/views.py index <HASH>..<HASH> 100644 --- a/examples/catalogs/bundles/views.py +++ b/examples/catalogs/bundles/views.py @@ -7,7 +7,7 @@ class BaseWebView(object): def __init__(self, services): """Initializer. - :type services: Services + :type services: catalogs.Services :param services: Bundle of service providers """ self.services = services
Fix typy-hinting in catalog bundles example
ets-labs_python-dependency-injector
train
py
6bbd8940901f0cec2ec3b871b6d9e8a31373e3bc
diff --git a/lib/ohai/version.rb b/lib/ohai/version.rb index <HASH>..<HASH> 100644 --- a/lib/ohai/version.rb +++ b/lib/ohai/version.rb @@ -18,5 +18,5 @@ module Ohai OHAI_ROOT = File.expand_path(File.dirname(__FILE__)) - VERSION = '7.6.0.dev' + VERSION = '7.6.0.rc.0' end
bumping to <I>.rc<I>
chef_ohai
train
rb
44a5585909f5e46d977d28690cf35300f4fe8a6a
diff --git a/pandasdmx/api.py b/pandasdmx/api.py index <HASH>..<HASH> 100644 --- a/pandasdmx/api.py +++ b/pandasdmx/api.py @@ -340,7 +340,7 @@ class Request(object): content_type = response.headers.get('content-type', None) try: Reader = get_reader_for_content_type(content_type) - except KeyError: + except ValueError: try: content_type = self.source.handle_response(response, response_content)
fix exception used to handle unknown content-types
dr-leo_pandaSDMX
train
py
f5fa4c0e02051729bc30c8f6d301e01c8244ea99
diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index <HASH>..<HASH> 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -5000,6 +5000,8 @@ WHERE gradeitemid IS NOT NULL AND grademax IS NOT NULL"); $textlib = textlib_get_instance(); foreach ($rs as $question) { + // may take awhile + upgrade_set_timeout(); if (empty($question->image)) { continue; } @@ -5078,6 +5080,8 @@ WHERE gradeitemid IS NOT NULL AND grademax IS NOT NULL"); FROM {question_answers} qa JOIN {question} q ON qa.question = q.id'); foreach ($rs as $record) { + // may take awhile + upgrade_set_timeout(); // Convert question_answers.answer if ($record->qtype !== 'multichoice') { $record->answerformat = FORMAT_PLAIN; @@ -5116,6 +5120,8 @@ WHERE gradeitemid IS NOT NULL AND grademax IS NOT NULL"); if ($CFG->texteditors !== 'textarea') { $rs = $DB->get_recordset('question', array('questiontextformat'=>FORMAT_MOODLE)); foreach ($rs as $record) { + // may take awhile + upgrade_set_timeout(); $record->questiontext = text_to_html($record->questiontext, false, false, true); $record->questiontextformat = FORMAT_HTML; $record->generalfeedback = text_to_html($record->generalfeedback, false, false, true);
MDL-<I> adding some upgrade_set_timeout() calls to <I> upgrade block, upgrades on questions were timing out
moodle_moodle
train
php
6d1d257fa6d5ef789a0512c32cd49a3ce406a62e
diff --git a/src/toil/lib/bioio.py b/src/toil/lib/bioio.py index <HASH>..<HASH> 100644 --- a/src/toil/lib/bioio.py +++ b/src/toil/lib/bioio.py @@ -124,12 +124,15 @@ def _addLoggingOptions(addOptionFn): # BEFORE YOU ADD OR REMOVE OPTIONS TO THIS FUNCTION, KNOW THAT YOU MAY ONLY USE VARIABLES ACCEPTED BY BOTH # optparse AND argparse FOR EXAMPLE, YOU MAY NOT USE default=%default OR default=%(default)s defaultLogLevelName = logging.getLevelName( defaultLogLevel ) - addOptionFn("--logOff", dest="logCritical", action="store_true", default=False, + addOptionFn("--logOff", dest="logLevel", + default=defaultLogLevelName, + action="store_const", const="CRITICAL", help="Same as --logCritical") for level in supportedLogLevels: levelName = logging.getLevelName(level) levelNameCapitalized = levelName.capitalize() addOptionFn("--log" + levelNameCapitalized, dest="logLevel", + default=defaultLogLevelName, action="store_const", const=levelName, help="Turn on logging at level %s and above. (default is %s)" % (levelName, defaultLogLevelName)) addOptionFn("--logLevel", dest="logLevel", default=defaultLogLevelName,
Stop log level option defaults from clobbering each other The default default of None for some of the options with a dest of "logLevel" was overriding the explicitly set default. Adding an explicit default to all of them solves the problem. Also restores functionality of the --logOff option which didn't work. Fixes #<I> by having a non-None logLevel for --realTimeLogging to use. (resolves #<I>)
DataBiosphere_toil
train
py
4493c0799329e6d92b0106a260e08738b0b58ded
diff --git a/src/geo/map.js b/src/geo/map.js index <HASH>..<HASH> 100644 --- a/src/geo/map.js +++ b/src/geo/map.js @@ -282,6 +282,10 @@ var Map = Model.extend({ return this.layers.at(i); }, + getLayerById: function (id) { + return this.layers.get(id); + }, + getLayerViewByLayerCid: function(cid) { return this.layers.get(cid); }, diff --git a/test/spec/geo/map.spec.js b/test/spec/geo/map.spec.js index <HASH>..<HASH> 100644 --- a/test/spec/geo/map.spec.js +++ b/test/spec/geo/map.spec.js @@ -388,4 +388,17 @@ describe('core/geo/map', function() { }); }); }); + + describe('.getLayerById', function () { + beforeEach(function () { + var layer1 = new CartoDBLayer({ id: 'xyz-123', attribution: 'attribution1' }); + + map.layers.reset(layer1); + }); + + it('should return the corresponding model for given id', function () { + expect(map.getLayerById('xyz-123')).toBeDefined(); + expect(map.getLayerById('meh')).toBeUndefined(); + }); + }); });
Add method to get layer by id
CartoDB_carto.js
train
js,js
e8c832f5740b9e2a6a3f2b814667ac702d3d5080
diff --git a/BimServer/src/org/bimserver/database/berkeley/BerkeleyKeyValueStore.java b/BimServer/src/org/bimserver/database/berkeley/BerkeleyKeyValueStore.java index <HASH>..<HASH> 100644 --- a/BimServer/src/org/bimserver/database/berkeley/BerkeleyKeyValueStore.java +++ b/BimServer/src/org/bimserver/database/berkeley/BerkeleyKeyValueStore.java @@ -584,9 +584,9 @@ public class BerkeleyKeyValueStore implements KeyValueStore { public synchronized void incrementReads(long reads) { this.reads += reads; - if (this.reads / 200000 != lastPrintedReads) { + if (this.reads / 1000000 != lastPrintedReads) { LOGGER.info("reads: " + this.reads); - lastPrintedReads = this.reads / 200000; + lastPrintedReads = this.reads / 1000000; } }
Less verbose logging
opensourceBIM_BIMserver
train
java
0d045630c8ecdbde795b9e6083fb6e89e6e4c98b
diff --git a/query/bridges.go b/query/bridges.go index <HASH>..<HASH> 100644 --- a/query/bridges.go +++ b/query/bridges.go @@ -85,10 +85,10 @@ func (b ProxyQueryServiceAsyncBridge) Query(ctx context.Context, w io.Writer, re defer results.Release() encoder := req.Dialect.Encoder() - _, err = encoder.Encode(w, results) - if err != nil { + if _, err := encoder.Encode(w, results); err != nil { return flux.Statistics{}, tracing.LogError(span, err) } + results.Release() stats := results.Statistics() return stats, nil
fix(query): release the query results before requesting statistics (#<I>) The statistics are only finalized after release is called. Defer a call to release to ensure they are released, but explicitly release on success to ensure that the statistics are finalized from all sources before returning them.
influxdata_influxdb
train
go
40a6546eab3fdefc8f37e29984fffef3f2552dce
diff --git a/test/common/util.js b/test/common/util.js index <HASH>..<HASH> 100644 --- a/test/common/util.js +++ b/test/common/util.js @@ -128,10 +128,14 @@ function loadOptions() { delay: 100, viewportWidth: 400, viewportHeight: 300, - headless: process.platform === 'linux' + headless: headless() }; } +function headless() { + return process.platform === 'linux'; +} + /** * Handle puppeteer output. * https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#class-consolemessage @@ -153,5 +157,6 @@ module.exports = { loadTemplate, takeReference, testSST, + headless, PORT, }; diff --git a/test/integration/render/render.test.js b/test/integration/render/render.test.js index <HASH>..<HASH> 100644 --- a/test/integration/render/render.test.js +++ b/test/integration/render/render.test.js @@ -18,7 +18,7 @@ describe('Render tests:', () => { before(done => { server = http.createServer(handler); server.listen(util.PORT); - exquisite.browser().then(_browser => { + exquisite.browser(util.headless()).then(_browser => { browser = _browser; done(); });
Enable headless for render tests (Linux)
CartoDB_carto-vl
train
js,js
d8b6eee9d491b64f28bff198f47f5823729b2cf0
diff --git a/src/utils/helper.js b/src/utils/helper.js index <HASH>..<HASH> 100644 --- a/src/utils/helper.js +++ b/src/utils/helper.js @@ -839,3 +839,32 @@ export const hasCustomRenderer = (props = {}) => { const { render, children } = props; return isFunction(children) || isFunction(render); }; + +// https://stackoverflow.com/a/65939108/10822996 +export const saveDataAsFile = ( + filename = 'exportedData', + data, + format = 'csv', // csv or json +) => { + let dataToWrite = data; + const dataType = `text/${format}`; + + if (format === 'json') { + dataToWrite = JSON.stringify(dataToWrite, 0, 4); + } + const blob = new Blob([dataToWrite], { type: dataType }); + const link = document.createElement('a'); + + link.download = `${filename}.${format}`; + link.href = window.URL.createObjectURL(blob); + link.dataset.downloadurl = [dataType, link.download, link.href].join(':'); + + const evt = new MouseEvent('click', { + view: window, + bubbles: true, + cancelable: true, + }); + + link.dispatchEvent(evt); + link.remove(); +};
feat: add helper method to download csv and json files to desktop
appbaseio_reactivecore
train
js
73ac2767c182083a903e1e870d1c27fb79960d55
diff --git a/spec/rubocop/cli/cli_options_spec.rb b/spec/rubocop/cli/cli_options_spec.rb index <HASH>..<HASH> 100644 --- a/spec/rubocop/cli/cli_options_spec.rb +++ b/spec/rubocop/cli/cli_options_spec.rb @@ -163,7 +163,7 @@ describe RuboCop::CLI, :isolated_environment do # Since we define a new cop class, we have to do this in a separate # process. Otherwise, the extra cop will affect other specs. output = - `ruby -I . #{rubocop} --require redirect.rb --only Style/SomeCop` + `ruby -I . "#{rubocop}" --require redirect.rb --only Style/SomeCop` expect($CHILD_STATUS.success?).to be_truthy expect(output) .to eq(['Inspecting 2 files',
Handle rubocop parent dirs with spaces in them
rubocop-hq_rubocop
train
rb
74843f358a6f5c775977b3618e263719af24f266
diff --git a/Src/java/cql-to-elm/src/main/java/org/cqframework/cql/cql2elm/LibraryBuilder.java b/Src/java/cql-to-elm/src/main/java/org/cqframework/cql/cql2elm/LibraryBuilder.java index <HASH>..<HASH> 100644 --- a/Src/java/cql-to-elm/src/main/java/org/cqframework/cql/cql2elm/LibraryBuilder.java +++ b/Src/java/cql-to-elm/src/main/java/org/cqframework/cql/cql2elm/LibraryBuilder.java @@ -175,6 +175,15 @@ public class LibraryBuilder { if (result == null) { if (modelName == null || modelName.equals("")) { + // Attempt to resolve in the default model if one is available + if (defaultModel != null) { + DataType modelResult = defaultModel.resolveTypeName(typeName); + if (modelResult != null) { + return modelResult; + } + } + + // Otherwise, resolve across all models and throw for ambiguous resolution for (Model model : models.values()) { DataType modelResult = model.resolveTypeName(typeName); if (modelResult != null) {
Fixed an issue with default model resolution.
cqframework_clinical_quality_language
train
java
8bb85306c92fc845e13073f9ed1b8e6390392e9d
diff --git a/tests/TestCase/Shell/BakeShellTest.php b/tests/TestCase/Shell/BakeShellTest.php index <HASH>..<HASH> 100644 --- a/tests/TestCase/Shell/BakeShellTest.php +++ b/tests/TestCase/Shell/BakeShellTest.php @@ -104,7 +104,7 @@ class BakeShellTest extends TestCase { ->method('out') ->with($this->stringContains('The following commands')); - $this->Shell->expects($this->exactly(19)) + $this->Shell->expects($this->exactly(18)) ->method('out'); $this->Shell->loadTasks();
Update BakeShellTest testMain to expect correct number of out() calls
cakephp_cakephp
train
php
6295be9329fcc953c6fd51e84775306afb6000f3
diff --git a/src/AppBundle/Service/GoogleApiService.php b/src/AppBundle/Service/GoogleApiService.php index <HASH>..<HASH> 100644 --- a/src/AppBundle/Service/GoogleApiService.php +++ b/src/AppBundle/Service/GoogleApiService.php @@ -66,6 +66,11 @@ class GoogleApiService { /** @var \Google_Service_Sheets_SheetProperties $sp */ $sp = &$s['properties']; + // Skip all sheets with trailing underscore + if (preg_match('~_$~', $sp->getTitle())) { + continue; + } + $sheets[$sp->getTitle()] = [ // TODO we could decide batchGet basedon the size of the batch. Do we care? // 'columnCount' => $sp->getGridProperties()->getColumnCount(),
Skipping sheets with trailing underscores
xmlsquad_capture-lookups
train
php
4fde43deee22b53fcca52132c51c27f4012d2933
diff --git a/lib/server.js b/lib/server.js index <HASH>..<HASH> 100644 --- a/lib/server.js +++ b/lib/server.js @@ -85,7 +85,7 @@ var start = function(injector, config, launcher, globalEmitter, preprocess, file socketServer.sockets.on('connection', function (socket) { log.debug('A browser has connected on socket ' + socket.id); - var replySocketEvents = events.bufferEvents(socket, ['info', 'error', 'result', 'complete']); + var replySocketEvents = events.bufferEvents(socket, ['start', 'info', 'error', 'result', 'complete']); socket.on('register', function(info) { var newBrowser;
fix(browser): reply "start" event When a browser creates another socket.io connection, we forget the old one, however we need to reply all the events that happens in that connection. Somehow I forgot to reply "start" event, which caused the "Adapter did not report number of tests" warning.
karma-runner_karma
train
js
609b01eaaea81c3c67995d5128af921120531116
diff --git a/pkg/minikube/download/preload.go b/pkg/minikube/download/preload.go index <HASH>..<HASH> 100644 --- a/pkg/minikube/download/preload.go +++ b/pkg/minikube/download/preload.go @@ -144,9 +144,10 @@ func Preload(k8sVersion, containerRuntime string) error { checksum, err := getChecksum(k8sVersion, containerRuntime) if err != nil { - return errors.Wrap(err, "getting checksum") + klog.Warningf("No checksum for preloaded tarball for k8s version %s", k8sVersion) + } else if checksum != "" { + url += "?checksum=" + checksum } - url += "?checksum=" + checksum if err := download(url, targetPath); err != nil { return errors.Wrapf(err, "download failed: %s", url)
Only show warning when checksum is missing
kubernetes_minikube
train
go
c8ca301da7baef90bb13e5b7aa62e45a35cfa315
diff --git a/visor-reporting-json-tcp/src/main/java/de/uniulm/omi/cloudiator/visor/reporting/json/JsonReportingInterface.java b/visor-reporting-json-tcp/src/main/java/de/uniulm/omi/cloudiator/visor/reporting/json/JsonReportingInterface.java index <HASH>..<HASH> 100644 --- a/visor-reporting-json-tcp/src/main/java/de/uniulm/omi/cloudiator/visor/reporting/json/JsonReportingInterface.java +++ b/visor-reporting-json-tcp/src/main/java/de/uniulm/omi/cloudiator/visor/reporting/json/JsonReportingInterface.java @@ -77,6 +77,7 @@ public class JsonReportingInterface implements ReportingInterface<Metric> { String metricString = om.writeValueAsString(new DecoratedMetric(item)); OutputStreamWriter osw = new OutputStreamWriter(socket.getOutputStream(), Charsets.UTF_8); osw.write(metricString); + osw.flush(); } catch (JsonProcessingException e) { throw new ReportingException(String.format("Could not convert metric %s to json", item), e); } catch (IOException e) {
JSON TCP reporter now flushes the output stream
cloudiator_visor
train
java
b2aaf3e867cb62cd7fae2373484f2da639b3d2b6
diff --git a/src/auth/Bearer.php b/src/auth/Bearer.php index <HASH>..<HASH> 100644 --- a/src/auth/Bearer.php +++ b/src/auth/Bearer.php @@ -67,6 +67,16 @@ class Bearer return openssl_decrypt(base64_decode($string), $this->method, $key, 0, $iv); } + public static function Is() + { + $data = Bearer::getBearerToken(); + if ($data === null) { + return false; + } + + return true; + } + #region authentication public function Login($username, $password) { diff --git a/src/pdc/Auth.php b/src/pdc/Auth.php index <HASH>..<HASH> 100644 --- a/src/pdc/Auth.php +++ b/src/pdc/Auth.php @@ -13,6 +13,7 @@ namespace pukoframework\pdc; use pte\CustomRender; use pte\Pte; +use pukoframework\auth\Bearer; use pukoframework\auth\Cookies; use pukoframework\auth\Session; use pukoframework\Response; @@ -71,6 +72,9 @@ class Auth implements Pdc, CustomRender if ($this->switch === 'session') { $hasPermission = Session::Is(); } + if ($this->switch === 'bearer') { + $hasPermission = Bearer::Is(); + } if (!$hasPermission) { $data = array( 'exception' => 'Authentication Required'
update pdc with bearer class support
Velliz_pukoframework
train
php,php
8c0744005d185f305b19e5533896e9c0dee53347
diff --git a/lib/locale_setter/version.rb b/lib/locale_setter/version.rb index <HASH>..<HASH> 100644 --- a/lib/locale_setter/version.rb +++ b/lib/locale_setter/version.rb @@ -1,3 +1,3 @@ module LocaleSetter - VERSION = "0.1.0" + VERSION = "0.1.1" end
version bump for current_user bugfix
jcasimir_locale_setter
train
rb
e6ad7fe4e59454494d964481bf2d3430acbe2de5
diff --git a/airflow/operators/slack_operator.py b/airflow/operators/slack_operator.py index <HASH>..<HASH> 100644 --- a/airflow/operators/slack_operator.py +++ b/airflow/operators/slack_operator.py @@ -67,7 +67,7 @@ class SlackAPIPostOperator(SlackAPIOperator): :type attachments: array of hashes """ - template_fields = ('username', 'text') + template_fields = ('username', 'text', 'attachments') ui_color = '#FFBA40' @apply_defaults
allow slack attachments to be templated
apache_airflow
train
py
b613d033f764566edfb7f777ed8dbdc402214fc5
diff --git a/framework/Dbal/QueryBuilder.php b/framework/Dbal/QueryBuilder.php index <HASH>..<HASH> 100644 --- a/framework/Dbal/QueryBuilder.php +++ b/framework/Dbal/QueryBuilder.php @@ -29,7 +29,7 @@ class QueryBuilder $what = preg_split('~[\s]*\,[\s]*~', $what[0]); } } - $what = array_map([get_called_class(), 'trim'], $what); + $what = array_map([$this, 'trim'], $what); return $what; } @@ -178,4 +178,4 @@ class QueryBuilder return $this->params; } -} \ No newline at end of file +}
Update QueryBuilder.php fix strict standart
pr-of-it_t4
train
php
31705749e40be5d920d3507756545ec15dda566e
diff --git a/src/calmjs/tests/test_toolchain.py b/src/calmjs/tests/test_toolchain.py index <HASH>..<HASH> 100644 --- a/src/calmjs/tests/test_toolchain.py +++ b/src/calmjs/tests/test_toolchain.py @@ -92,6 +92,11 @@ class ToolchainTestCase(unittest.TestCase): def tearDown(self): pass + def test_toolchain_calf_not_spec(self): + # can't just use a normal dict + with self.assertRaises(TypeError): + self.toolchain({}) + def test_toolchain_standard_not_implemented(self): spec = Spec() diff --git a/src/calmjs/toolchain.py b/src/calmjs/toolchain.py index <HASH>..<HASH> 100644 --- a/src/calmjs/toolchain.py +++ b/src/calmjs/toolchain.py @@ -234,6 +234,9 @@ class Toolchain(object): Requires the filename which everything will be produced to. """ + if not isinstance(spec, Spec): + raise TypeError('spec must be of type Spec') + if 'build_dir' not in spec: tempdir = mkdtemp() spec.add_callback('cleanup', shutil.rmtree, tempdir)
Ensure calf is called with a Spec type.
calmjs_calmjs
train
py,py
cc3815330eef0b505a860958259cc228af7c245f
diff --git a/gooey/python_bindings/gooey_decorator.py b/gooey/python_bindings/gooey_decorator.py index <HASH>..<HASH> 100644 --- a/gooey/python_bindings/gooey_decorator.py +++ b/gooey/python_bindings/gooey_decorator.py @@ -51,6 +51,8 @@ import types import wx +import tempfile + from gooey.gui.lang import i18n from gooey.gui.windows import layouts from gooey.python_bindings import argparse_to_json @@ -58,7 +60,7 @@ import source_parser ROOT_DIR = os.path.dirname(__import__(__name__.split('.')[0]).__file__) -TMP_DIR = os.path.join(ROOT_DIR, '_tmp') +TMP_DIR = tempfile.mkdtemp() def Gooey(f=None, advanced=True, language='english', show_config=True, @@ -83,6 +85,7 @@ def Gooey(f=None, advanced=True, cleaned_source = clean_source(main_module_path) filepath = os.path.join(TMP_DIR, filename) + print(filepath) with open(filepath, 'w') as f: f.write(cleaned_source)
Switched temp directory for issue #<I>
chriskiehl_Gooey
train
py
8831b8f38f7634d1d5689d819c46c34cbca1c88e
diff --git a/core/src/main/java/tachyon/util/CommonUtils.java b/core/src/main/java/tachyon/util/CommonUtils.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/tachyon/util/CommonUtils.java +++ b/core/src/main/java/tachyon/util/CommonUtils.java @@ -44,6 +44,7 @@ import tachyon.TachyonURI; import tachyon.conf.TachyonConf; import tachyon.thrift.InvalidPathException; import tachyon.underfs.UnderFileSystem; + import sun.misc.Cleaner; import sun.nio.ch.DirectBuffer;
Add a line to separate tachyon.* and sun.* in import
Alluxio_alluxio
train
java
450d1901b230d0d7426829f182fbe655f7f91679
diff --git a/core/src/test/java/org/jsmart/zerocode/core/runner/retry/ZeroCodeMultiStepsScenarioRunnerImplRetryTest.java b/core/src/test/java/org/jsmart/zerocode/core/runner/retry/ZeroCodeMultiStepsScenarioRunnerImplRetryTest.java index <HASH>..<HASH> 100644 --- a/core/src/test/java/org/jsmart/zerocode/core/runner/retry/ZeroCodeMultiStepsScenarioRunnerImplRetryTest.java +++ b/core/src/test/java/org/jsmart/zerocode/core/runner/retry/ZeroCodeMultiStepsScenarioRunnerImplRetryTest.java @@ -24,7 +24,7 @@ public class ZeroCodeMultiStepsScenarioRunnerImplRetryTest { private static final ObjectMapper mapper = new ObjectMapperProvider().get(); @Test - public void test_FailSimpleAssertionInMultiStep() { + public void testRetryScenarios() { final String SCENARIO_RETRY = "Rest with Retry Test"; final String SCENARIO_RETRY_LOOP = "Rest with Retry within loop Test";
ISS-<I> # renamed test-method
authorjapps_zerocode
train
java
70d3c34d47e33052d93b6731ad5ec1d3f1845282
diff --git a/src/Command/Helper/KernelHelper.php b/src/Command/Helper/KernelHelper.php index <HASH>..<HASH> 100644 --- a/src/Command/Helper/KernelHelper.php +++ b/src/Command/Helper/KernelHelper.php @@ -139,4 +139,10 @@ class KernelHelper extends Helper return $this->class_loader; } + /** + * @return \Symfony\Component\HttpFoundation\Request + */ + public function getRequest(){ + return $this->request; + } }
Add getRequest method to KernelHelper Class
hechoendrupal_drupal-console
train
php
21abab450822e65a0e972a848bbd4b83efe62431
diff --git a/fullstop-plugins/fullstop-application-masterdata-plugin/src/test/java/org/zalando/stups/fullstop/plugin/config/ApplicationMasterdataPluginAutoConfigurationTest.java b/fullstop-plugins/fullstop-application-masterdata-plugin/src/test/java/org/zalando/stups/fullstop/plugin/config/ApplicationMasterdataPluginAutoConfigurationTest.java index <HASH>..<HASH> 100644 --- a/fullstop-plugins/fullstop-application-masterdata-plugin/src/test/java/org/zalando/stups/fullstop/plugin/config/ApplicationMasterdataPluginAutoConfigurationTest.java +++ b/fullstop-plugins/fullstop-application-masterdata-plugin/src/test/java/org/zalando/stups/fullstop/plugin/config/ApplicationMasterdataPluginAutoConfigurationTest.java @@ -15,10 +15,8 @@ */ package org.zalando.stups.fullstop.plugin.config; -import org.assertj.core.api.Assertions; import org.junit.Test; import org.junit.runner.RunWith; -import org.mockito.Mockito; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.context.annotation.Bean;
#<I> removed unused imports
zalando-stups_fullstop
train
java
880f8c859cf855cebeea2501769f864b7fc37a60
diff --git a/tests/TestCase/Core/AppTest.php b/tests/TestCase/Core/AppTest.php index <HASH>..<HASH> 100644 --- a/tests/TestCase/Core/AppTest.php +++ b/tests/TestCase/Core/AppTest.php @@ -44,7 +44,7 @@ class AppTest extends TestCase { * @dataProvider classnameProvider * @return void */ - public function testClassname($class, $type, $suffix = '', $existsInBase = false, $expected = false) { + public function _testClassname($class, $type, $suffix = '', $existsInBase = false, $expected = false) { Configure::write('App.namespace', 'TestApp'); $mock = $this->getMockClass('Cake\Core\App', ['_classExistsInBase']);
Temporarily skiping a test that requires staticExpects
cakephp_cakephp
train
php
da13cbe1318156299c475eb52de5394d38329747
diff --git a/cmd/runhcs/main.go b/cmd/runhcs/main.go index <HASH>..<HASH> 100644 --- a/cmd/runhcs/main.go +++ b/cmd/runhcs/main.go @@ -35,7 +35,7 @@ const ( specConfig = "config.json" usage = `Open Container Initiative runtime -runhcs is fork of runc modified to run on Windows with Hyper-V isolated Linux containers. It is a command line client for running applications packaged according to the Open Container Initiative (OCI) format and is a compliant implementation of the Open Container Initiative specification. +runhcs is fork of runc modified to run on Windows with Hyper-V isolated containers. It is a command line client for running applications packaged according to the Open Container Initiative (OCI) format and is a compliant implementation of the Open Container Initiative specification. runhcs integrates with existing process supervisors to provide a production container runtime environment for applications. It can be used with your existing process monitoring tools and the container will be spawned as a direct child of the process supervisor.
updated main to refer to Hyper-V isolated containers rather than lcow based on references to wcow
Microsoft_hcsshim
train
go
6308334694741741f8619b258947c90f2dfc8d39
diff --git a/micrometer-core/src/test/java/io/micrometer/core/instrument/binder/tomcat/TomcatMetricsTest.java b/micrometer-core/src/test/java/io/micrometer/core/instrument/binder/tomcat/TomcatMetricsTest.java index <HASH>..<HASH> 100644 --- a/micrometer-core/src/test/java/io/micrometer/core/instrument/binder/tomcat/TomcatMetricsTest.java +++ b/micrometer-core/src/test/java/io/micrometer/core/instrument/binder/tomcat/TomcatMetricsTest.java @@ -229,7 +229,7 @@ class TomcatMetricsTest { assertThat(registry.get("tomcat.global.request").functionTimer().totalTime(TimeUnit.MILLISECONDS)).isGreaterThan(0.0); assertThat(registry.get("tomcat.global.request.max").timeGauge().value(TimeUnit.MILLISECONDS)).isGreaterThan(0.0); assertThat(registry.get("tomcat.threads.config.max").gauge().value()).isGreaterThan(0.0); - assertThat(registry.get("tomcat.threads.busy").gauge().value()).isEqualTo(0.0); + assertThat(registry.get("tomcat.threads.busy").gauge().value()).isGreaterThanOrEqualTo(0.0); assertThat(registry.get("tomcat.threads.current").gauge().value()).isGreaterThan(0.0); } }
Relax assertion for tomcat.threads.busy (#<I>) Closes gh-<I>
micrometer-metrics_micrometer
train
java
fd925f9581f6a796a005ea7a7a6609686c67b87e
diff --git a/safe/impact_functions/inundation/flood_vector_building_impact/impact_function.py b/safe/impact_functions/inundation/flood_vector_building_impact/impact_function.py index <HASH>..<HASH> 100644 --- a/safe/impact_functions/inundation/flood_vector_building_impact/impact_function.py +++ b/safe/impact_functions/inundation/flood_vector_building_impact/impact_function.py @@ -171,9 +171,16 @@ class FloodPolygonBuildingFunction( ', '.join(self.hazard_class_mapping[self.wet])) raise GetDataError(message) + transform = QgsCoordinateTransform( + self.exposure.layer.crs(), + self.hazard.layer.crs() + ) + features = [] for feature in self.exposure.layer.getFeatures(request): building_geom = feature.geometry() + # Project the building geometry to hazard CRS + building_geom = transform.transform(building_geom) affected = False # get tentative list of intersecting hazard features # only based on intersection of bounding boxes
Initial implementation for #<I> - support On the fly projection in IF
inasafe_inasafe
train
py
df8eb4af9042aa5deda8f3f9e98ca88d0c3a7104
diff --git a/lease/lease_test.go b/lease/lease_test.go index <HASH>..<HASH> 100644 --- a/lease/lease_test.go +++ b/lease/lease_test.go @@ -340,7 +340,11 @@ func (s *leaseSuite) TestLeaseExpiration(c *gc.C) { c.Assert(err, jc.ErrorIsNil) receivedSignal := make(chan struct{}) - var leaseClaimedTime time.Time + // Grab a lease. + _, err = s.manager.ClaimLease(testNamespace, testId, leaseDuration) + leaseClaimedTime := time.Now() + c.Assert(err, jc.ErrorIsNil) + go func() { <-subscription @@ -361,11 +365,6 @@ func (s *leaseSuite) TestLeaseExpiration(c *gc.C) { } }() - // Grab a lease. - _, err = s.manager.ClaimLease(testNamespace, testId, leaseDuration) - leaseClaimedTime = time.Now() - c.Assert(err, jc.ErrorIsNil) - // Wait for the all-clear, or a time-out. select { case <-receivedSignal:
lease: fix data race in tests (again) Fixes LP <I> Fixes LP <I> (again)
juju_juju
train
go
3325cdf58b55986ae56540afe70c6c3611c4c550
diff --git a/spec/fake_app/fake_app.rb b/spec/fake_app/fake_app.rb index <HASH>..<HASH> 100644 --- a/spec/fake_app/fake_app.rb +++ b/spec/fake_app/fake_app.rb @@ -112,7 +112,7 @@ end class BooksController < ApplicationController class CustomError < StandardError; end - rescue_from "CustomError" do + rescue_from CustomError do render "error" end
Prefer rescuing a class, not a class name
amatsuda_active_decorator
train
rb
5e98f099b86f821a566b751eea62d640860b1898
diff --git a/xchange-core/src/main/java/org/knowm/xchange/service/account/AccountService.java b/xchange-core/src/main/java/org/knowm/xchange/service/account/AccountService.java index <HASH>..<HASH> 100644 --- a/xchange-core/src/main/java/org/knowm/xchange/service/account/AccountService.java +++ b/xchange-core/src/main/java/org/knowm/xchange/service/account/AccountService.java @@ -93,10 +93,11 @@ public interface AccountService extends BaseService { /** * @return list of funding history if available or an empty list otherwise. This should never return null. - * @throws ExchangeException - * @throws NotAvailableFromExchangeException - * @throws NotYetImplementedForExchangeException - * @throws IOException + * @throws ExchangeException - Indication that the exchange reported some kind of error with the request or response + * @throws NotAvailableFromExchangeException - Indication that the exchange does not support the requested function or data + * @throws NotYetImplementedForExchangeException - Indication that the exchange supports the requested function or data, but it has not yet been + * implemented + * @throws IOException - Indication that a networking error occurred while fetching JSON data */ List<FundingRecord> getFundingHistory( TradeHistoryParams params) throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException, IOException;
[core] fill out the missing @throws tag descriptions
knowm_XChange
train
java
2ad4dd2fe877248b33aefa4465352710f95d953a
diff --git a/djlotrek/decorators.py b/djlotrek/decorators.py index <HASH>..<HASH> 100644 --- a/djlotrek/decorators.py +++ b/djlotrek/decorators.py @@ -5,6 +5,7 @@ import requests def check_recaptcha(view_func): + """Chech that the entered recaptcha data is correct""" @wraps(view_func) def _wrapped_view(request, *args, **kwargs): request.recaptcha_is_valid = None
Add docstring to recaptcha check
lotrekagency_djlotrek
train
py
6d73071aeb1e252e5f52dbbd01173336bdd48e99
diff --git a/src/Sylius/Bundle/CoreBundle/Application/Kernel.php b/src/Sylius/Bundle/CoreBundle/Application/Kernel.php index <HASH>..<HASH> 100644 --- a/src/Sylius/Bundle/CoreBundle/Application/Kernel.php +++ b/src/Sylius/Bundle/CoreBundle/Application/Kernel.php @@ -31,12 +31,12 @@ use Webmozart\Assert\Assert; class Kernel extends HttpKernel { - public const VERSION = '1.1.1'; - public const VERSION_ID = '10101'; + public const VERSION = '1.1.2-DEV'; + public const VERSION_ID = '10102'; public const MAJOR_VERSION = '1'; public const MINOR_VERSION = '1'; - public const RELEASE_VERSION = '1'; - public const EXTRA_VERSION = ''; + public const RELEASE_VERSION = '2'; + public const EXTRA_VERSION = 'DEV'; /** * {@inheritdoc}
Set version to <I>-DEV
Sylius_Sylius
train
php
1047eaeb635112ddbd2ec5c2604edd2dbd03e31b
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -126,9 +126,15 @@ function access(options) { // // The HTTP Access Control (CORS) uses the OPTIONS method to preflight // requests to it can get approval before doing the actual request. So it's - // vital that these requests are handled first and as soon as possible. + // vital that these requests are handled first and as soon as possible. But + // as OPTIONS requests can also be made for other types of requests need to + // explicitly check if the `Access-Control-Request-Method` header has been + // sent to ensure that this is a preflight request. // - if ('OPTIONS' === req.method) { + if ( + 'OPTIONS' === req.method + && req.headers['access-control-request-method'] + ) { if (options.maxAge) { setHeader(res, 'Access-Control-Max-Age', options.maxAge); } @@ -140,7 +146,7 @@ function access(options) { if (options.headers) { setHeader(res, 'Access-Control-Allow-Headers', options.headers); } else if (req.headers['access-control-request-headers']) { - setHeader(res, req.headers['access-control-request-headers']); + setHeader(res, 'Access-Control-Allow-Headers', req.headers['access-control-request-headers']); } //
[fix] Only handle cors when the correct header is set
primus_access-control
train
js
07485dba57f8f739f9c9b4fc82a2755f864a5cd7
diff --git a/src/dialects/sqlite3/query/compiler.js b/src/dialects/sqlite3/query/compiler.js index <HASH>..<HASH> 100644 --- a/src/dialects/sqlite3/query/compiler.js +++ b/src/dialects/sqlite3/query/compiler.js @@ -120,7 +120,10 @@ assign(QueryCompiler_SQLite3.prototype, { const maxLengthRegex = /.*\((\d+)\)/ const out = reduce(resp, function (columns, val) { let { type } = val - let maxLength = (maxLength = type.match(maxLengthRegex)) && maxLength[1] + let maxLength = type.match(maxLengthRegex) + if (maxLength) { + maxLength = maxLength[1] + } type = maxLength ? type.split('(')[0] : type columns[val.name] = { type: type.toLowerCase(),
Fix "maxLength is not defined" error in sqlite3 query compiler
tgriesser_knex
train
js
40bdabe42083a14125e8ba9b324ecf9d9fb7d0d2
diff --git a/niworkflows/interfaces/utils.py b/niworkflows/interfaces/utils.py index <HASH>..<HASH> 100644 --- a/niworkflows/interfaces/utils.py +++ b/niworkflows/interfaces/utils.py @@ -288,8 +288,8 @@ class SanitizeImage(SimpleInterface): | sform, scode <- qform, qcode | +-------------------+------------------+------------------+------------------\ +------------------------------------------------+ - | * | * | True | False \ -| qform, qcode <- sform, scode | + | * | True | * | False \ +| sform, scode <- qform, qcode | +-------------------+------------------+------------------+------------------\ +------------------------------------------------+ | * | False | True | * \ @@ -339,7 +339,7 @@ class SanitizeImage(SimpleInterface): self._results['out_file'] = out_fname # Row 2: - if valid_qform and qform_code > 0 and sform_code == 0: + if valid_qform and qform_code > 0: img.set_sform(img.get_qform(), qform_code) warning_txt = 'Note on orientation: sform matrix set' description = """\
if qform is valid always force sform to be have the same value
poldracklab_niworkflows
train
py
7850b1e43453ea370aedf15e909ec030ddb7b1f3
diff --git a/pysrt/srtitem.py b/pysrt/srtitem.py index <HASH>..<HASH> 100644 --- a/pysrt/srtitem.py +++ b/pysrt/srtitem.py @@ -11,11 +11,11 @@ from pysrt.srttime import SubRipTime class SubRipItem(object): """ - SubRipItem(sub_id, start, end, sub_title) + SubRipItem(index, start, end, text) - sub_id -> int: index of item in file. 0 by default. + index -> int: index of item in file. 0 by default. start, end -> SubRipTime or coercible. - sub_title -> unicode: text content for item. + text -> unicode: text content for item. """ TIME_PATTERN = r'\d{2}:\d{2}:\d{2}[,\.]\d{3}' ITEM_PATTERN = r'''\A(?P<index>\d+)$
doc: update outdated SubRipItem doc
byroot_pysrt
train
py
8a1e1eaaeb331ab1a60ac4718bff9baae956f120
diff --git a/vendor/k8s.io/kubernetes/plugin/pkg/admission/namespace/lifecycle/admission.go b/vendor/k8s.io/kubernetes/plugin/pkg/admission/namespace/lifecycle/admission.go index <HASH>..<HASH> 100644 --- a/vendor/k8s.io/kubernetes/plugin/pkg/admission/namespace/lifecycle/admission.go +++ b/vendor/k8s.io/kubernetes/plugin/pkg/admission/namespace/lifecycle/admission.go @@ -205,6 +205,7 @@ var accessReviewResources = map[unversioned.GroupResource]bool{ unversioned.GroupResource{Group: "", Resource: "resourceaccessreviews"}: true, unversioned.GroupResource{Group: "", Resource: "localresourceaccessreviews"}: true, unversioned.GroupResource{Group: "", Resource: "selfsubjectrulesreviews"}: true, + unversioned.GroupResource{Group: "", Resource: "subjectrulesreviews"}: true, } func isAccessReview(a admission.Attributes) bool {
UPSTREAM: <carry>: update namespace lifecycle to allow review APIs
openshift_origin
train
go
6b5247bfc26d71d2fc473c63f6750171a76f299e
diff --git a/spec/puppet-lint/plugins/check_resources/unquoted_file_mode_spec.rb b/spec/puppet-lint/plugins/check_resources/unquoted_file_mode_spec.rb index <HASH>..<HASH> 100644 --- a/spec/puppet-lint/plugins/check_resources/unquoted_file_mode_spec.rb +++ b/spec/puppet-lint/plugins/check_resources/unquoted_file_mode_spec.rb @@ -27,6 +27,14 @@ describe 'unquoted_file_mode' do expect(problems).to contain_warning(msg).on_line(1).in_column(25) end end + + context 'file mode from a function rvalue' do + let(:code) { "file { 'foo': mode => lookup('bar'), }" } + + it 'should not detect any problems' do + expect(problems).to have(0).problems + end + end end context 'with fix enabled' do @@ -69,5 +77,17 @@ describe 'unquoted_file_mode' do expect(manifest).to eq("concat { 'foo': mode => '0777' }") end end + + context 'file mode from a function rvalue' do + let(:code) { "file { 'foo': mode => lookup('bar'), }" } + + it 'should not detect any problems' do + expect(problems).to have(0).problems + end + + it 'should not change the manifest' do + expect(manifest).to eq(code) + end + end end end
Ensure that :FUNCTION_NAME tokens don't trigger the unquoted_file_mode check
rodjek_puppet-lint
train
rb
a874c8c8047949c6ca3d87737da630ae85d1811b
diff --git a/src/Popover/index.js b/src/Popover/index.js index <HASH>..<HASH> 100644 --- a/src/Popover/index.js +++ b/src/Popover/index.js @@ -91,8 +91,10 @@ const Popover = ({ setShownWithTimeout(true); resolveCallback(true); } - } else { - resolveCallback(!shown); + } else if (opened) { + resolveCallback(false); + } else if (!opened) { + resolveCallback(true); } }, [ clearRenderTimeout,
FIX: Popover callback loop (#<I>)
kiwicom_orbit-components
train
js
5fcc5398ecbcb83505e578a6ecee785d4464fbd5
diff --git a/master/buildbot/status/words.py b/master/buildbot/status/words.py index <HASH>..<HASH> 100644 --- a/master/buildbot/status/words.py +++ b/master/buildbot/status/words.py @@ -870,6 +870,10 @@ class Contact(base.StatusReceiver): reactor.callLater(3.5, self.send, "(7^.^)7") reactor.callLater(5.0, self.send, "(>^.^<)") + def command_HUSTLE(self, args): + reactor.callLater(1.0, self.send, "/me does the hustle") + command_HUSTLE.usage = "dondon on #qutebrowser: qutebrowser-bb needs to learn to do the hustle" + def command_SHUTDOWN(self, args): # FIXME: NEED TO THINK ABOUT! if args not in ('check', 'start', 'stop', 'now'):
Do the hustle Thought buildbot the hustle in 3 lines.
buildbot_buildbot
train
py
c14c5c16f27eb1d6769ed2dd55028187f8d121a8
diff --git a/lib/arel/visitors/dot.rb b/lib/arel/visitors/dot.rb index <HASH>..<HASH> 100644 --- a/lib/arel/visitors/dot.rb +++ b/lib/arel/visitors/dot.rb @@ -28,6 +28,11 @@ module Arel end private + def visit_Arel_Nodes_Count o + visit_edge o, "expressions" + visit_edge o, "distinct" + end + def visit_Arel_Nodes_StringJoin o visit_edge o, "left" visit_edge o, "right"
dot visitor can visit count nodes
rails_rails
train
rb
183cda63ccc181002279ff5e0e4427319cd30d5c
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # This file is part of REANA. -# Copyright (C) 2018, 2019, 2020 CERN. +# Copyright (C) 2018, 2019, 2020, 2021 CERN. # # REANA is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. @@ -19,7 +19,7 @@ readme = open("README.rst").read() history = open("CHANGES.rst").read() tests_require = [ - "pytest-reana>=0.8.0a6,<0.9.0", + "pytest-reana>=0.8.0a7,<0.9.0", ] extras_require = {
installation: pytest-reana version bump
reanahub_reana-db
train
py
8a8b92fe80a520f71dba5023726ff9dee18b202b
diff --git a/library/src/com/twotoasters/jazzylistview/JazzyHelper.java b/library/src/com/twotoasters/jazzylistview/JazzyHelper.java index <HASH>..<HASH> 100644 --- a/library/src/com/twotoasters/jazzylistview/JazzyHelper.java +++ b/library/src/com/twotoasters/jazzylistview/JazzyHelper.java @@ -78,7 +78,7 @@ public class JazzyHelper implements AbsListView.OnScrollListener { int indexBeforeLast = 0; while (lastVisibleItem - indexBeforeLast > mLastVisibleItem) { View item = view.getChildAt(lastVisibleItem - firstVisibleItem - indexBeforeLast); - doJazziness(item, lastVisibleItem, 1); + doJazziness(item, lastVisibleItem - indexBeforeLast, 1); indexBeforeLast++; } } else if (!shouldAnimateItems) {
Solved issue with "only_animate_new_items" for GridViews.
twotoasters_JazzyListView
train
java
ca2f8b9ab0dafeae8cbadf843130aea2de8a2073
diff --git a/pynapi/services/napiprojekt.py b/pynapi/services/napiprojekt.py index <HASH>..<HASH> 100644 --- a/pynapi/services/napiprojekt.py +++ b/pynapi/services/napiprojekt.py @@ -35,7 +35,12 @@ class Napiprojekt(serviceBase): if subs[0:4] != 'NPc0': # napiprojekt keeps subtitles in cp1250 - return codecs.decode(subs, 'cp1250') + # ... but, sometimes they are in utf8 + for cdc in ['cp1250', 'utf8']: + try: + return codecs.decode(subs, cdc) + except: + pass def discombobulate(self, filehash): """ prepare napiprojekt scrambled hash """ diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages setup( name = "pynapi", - version = '0.3', + version = '0.4', description = 'subtitles downloader', entry_points = { 'console_scripts': [ 'pynapi = pynapi.cmdline:cmdline' ] }, packages = find_packages()
napiprojekt keeps subtitles in cp<I>, but sometimes in utf8...
jabbas_pynapi
train
py,py
617bf08f9e1be92a695f6d8f273e7f3d3c316936
diff --git a/plugins/provisioners/puppet/provisioner/puppet.rb b/plugins/provisioners/puppet/provisioner/puppet.rb index <HASH>..<HASH> 100644 --- a/plugins/provisioners/puppet/provisioner/puppet.rb +++ b/plugins/provisioners/puppet/provisioner/puppet.rb @@ -19,7 +19,7 @@ module VagrantPlugins root_path = @machine.env.root_path @expanded_manifests_path = @config.expanded_manifests_path(root_path) @expanded_module_paths = @config.expanded_module_paths(root_path) - @manifest_file = File.join(@expanded_manifests_path, @config.manifest_file) + @manifest_file = File.join(manifests_guest_path, @config.manifest_file) # Setup the module paths @module_paths = []
Use the proper path on Puppet apply to the manifest
hashicorp_vagrant
train
rb
93e44f69de13bc11f5d38ad0c7dd3839e90a75fa
diff --git a/packet.js b/packet.js index <HASH>..<HASH> 100644 --- a/packet.js +++ b/packet.js @@ -542,10 +542,11 @@ function parseCname(val, msg) { } function parseTxt(val, msg, rdata) { - val.data = ''; + val.data = []; var end = msg.tell() + rdata.len; while (msg.tell() != end) { - val.data += msg.toString('ascii', msg.readUInt8()); + var len = msg.readUInt8(); + val.data.push(msg.toString('ascii', len)); } return PARSE_RESOURCE_DONE; }
txt rdata can be one or more strings
tjfontaine_native-dns-packet
train
js
9fad8fd7bfd1d3d042656e3f5f2b075ac0ccbd5a
diff --git a/gwpy/utils/tests/test_misc.py b/gwpy/utils/tests/test_misc.py index <HASH>..<HASH> 100644 --- a/gwpy/utils/tests/test_misc.py +++ b/gwpy/utils/tests/test_misc.py @@ -27,6 +27,8 @@ from .. import misc as utils_misc def test_gprint(capsys): + """Test for :func:`gwpy.utils.misc.gprint` + """ utils_misc.gprint('test') assert capsys.readouterr().out == 'test\n' utils_misc.gprint('test', end=' ') @@ -38,6 +40,8 @@ def test_gprint(capsys): def test_null_context(): + """Test for :func:`gwpy.utils.misc.null_context` + """ ctx = utils_misc.null_context() with ctx: print('this should work') @@ -48,4 +52,6 @@ def test_null_context(): (str, 1, '1'), ]) def test_if_not_none(func, value, out): + """Test for :func:`gwpy.utils.misc.if_not_none` + """ assert utils_misc.if_not_none(func, value) == out
gwpy.utils: added function docstrings [ci skip] for `tests/test_misc.py` to appease codacy
gwpy_gwpy
train
py
ae7d33df34f697d182ca26dfc22ae57fa82f3391
diff --git a/src/botpress.js b/src/botpress.js index <HASH>..<HASH> 100644 --- a/src/botpress.js +++ b/src/botpress.js @@ -114,7 +114,9 @@ class botpress { if (fs.existsSync(envPath)) { const envConfig = dotenv.parse(fs.readFileSync(envPath)) for (var k in envConfig) { - process.env[k] = envConfig[k] + if (_.isNil(process.env[k]) || process.env.ENV_OVERLOAD) { + process.env[k] = envConfig[k] + } } }
ENV doesn't overload args by default
botpress_botpress
train
js
6d188186d428668b91ddc60be4fb3c230dfec363
diff --git a/src/core.js b/src/core.js index <HASH>..<HASH> 100644 --- a/src/core.js +++ b/src/core.js @@ -338,6 +338,9 @@ jQuery.extend = jQuery.fn.extend = function() { }; jQuery.extend({ + // Unique for each copy of jQuery on the page + expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ), + noConflict: function( deep ) { if ( window.$ === jQuery ) { window.$ = _$; diff --git a/src/data.js b/src/data.js index <HASH>..<HASH> 100644 --- a/src/data.js +++ b/src/data.js @@ -201,10 +201,6 @@ data_priv = new Data(); jQuery.extend({ - // Unique for each copy of jQuery on the page - // Non-digits removed to match rinlinejQuery - expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ), - // This is no longer relevant to jQuery core, but must remain // supported for the sake of jQuery 1.9.x API surface compatibility. acceptData: function() {
No ticket: move jQuery.expando to core
jquery_jquery
train
js,js
41a3b04227dd50af974b4a0c4f38529e5f3a54bf
diff --git a/tasks/mb.js b/tasks/mb.js index <HASH>..<HASH> 100644 --- a/tasks/mb.js +++ b/tasks/mb.js @@ -28,10 +28,6 @@ module.exports = function (grunt) { waitFor(function () { return fs.existsSync(pidfile); }, callback); } - function whenFullyShutdown (pidfile, callback) { - waitFor(function () { return !fs.existsSync(pidfile); }, callback); - } - function pidfileFor (args) { var pidfileIndex = args.indexOf('--pidfile'); return pidfileIndex >= 0 && pidfileIndex < args.length - 1 ? args[pidfileIndex + 1] : 'mb.pid'; @@ -79,7 +75,7 @@ module.exports = function (grunt) { if (error) { grunt.fail.warn(error); } if (stdout) { grunt.log.writeln(stdout); } if (stderr) { grunt.log.error(stderr); } - whenFullyShutdown(pidfileFor(args), done); + done(); }); }
Removing wait for pidfile removal, the mb command already does that with a timeout as well
bbyars_grunt-mountebank
train
js
ae00e5304696c8139f49fa6985f8a88e32f62139
diff --git a/test/karma.conf.js b/test/karma.conf.js index <HASH>..<HASH> 100644 --- a/test/karma.conf.js +++ b/test/karma.conf.js @@ -33,7 +33,8 @@ module.exports = function(config) { } }, - browsers : ['Firefox', 'ChromeHeadless'], + browsers : ['ChromeHeadless'], + // browsers : ['Firefox', 'ChromeHeadless'], // use dots reporter, as travis terminal does not support escaping sequences // possible values: 'dots', 'progress'
fix(test) Speculative workaround - temporarily remove firefox
forms-angular_forms-angular
train
js
14997adf08abfcc0bf22e20d095dab4691b6d8cd
diff --git a/Sami/Renderer/Renderer.php b/Sami/Renderer/Renderer.php index <HASH>..<HASH> 100644 --- a/Sami/Renderer/Renderer.php +++ b/Sami/Renderer/Renderer.php @@ -236,7 +236,7 @@ class Renderer */ private function getTree(Project $project) { - $key = $project->getVersion()->getName(); + $key = $project->getBuildDir(); if (!isset($this->cachedTree[$key])) { $this->cachedTree[$key] = $this->tree->getTree($project); }
Use build dir as tree cache identifier
FriendsOfPHP_Sami
train
php
cd0526deb85431f01c29d992704b4313b185dc59
diff --git a/public/javascripts/promotion.js b/public/javascripts/promotion.js index <HASH>..<HASH> 100644 --- a/public/javascripts/promotion.js +++ b/public/javascripts/promotion.js @@ -388,7 +388,7 @@ var templateLibrary = (function(){ for( item in changesets){ if( changesets.hasOwnProperty(item) ){ //do the search filter here - if( changesets[item].name !== 'Changesets' ){ + if( item.split("_")[0] === "changeset" ){ html += changesetsListItem(item, changesets[item].name); } }
fixing changeset rendering to only show changesets.... again
Katello_katello
train
js
56f0adcf4928fb2620512e7eeb10076f8cdadd73
diff --git a/library/AcceptanceTestCase.php b/library/AcceptanceTestCase.php index <HASH>..<HASH> 100644 --- a/library/AcceptanceTestCase.php +++ b/library/AcceptanceTestCase.php @@ -1358,7 +1358,9 @@ abstract class AcceptanceTestCase extends MinkWrapper public function assertElementPresent($sLocator, $sMessage = '') { $sLocator = $this->translate($sLocator); - $this->_waitForAppear('isElementPresent', $sLocator, 5, true); + if ($this->currentMinkDriver !== 'goutte') { + $this->_waitForAppear('isElementPresent', $sLocator, 5, true); + } $isElementPresent = $this->isElementPresent($sLocator); $sFailMessage = "Element $sLocator was not found! " . $sMessage;
Goutte driver does not support windows management When using goutte driver and element was not found, completely different message was shown.
OXID-eSales_testing_library
train
php
2e95500ff18daeebe6dea005b12237f907999639
diff --git a/test/tc_joins.rb b/test/tc_joins.rb index <HASH>..<HASH> 100644 --- a/test/tc_joins.rb +++ b/test/tc_joins.rb @@ -226,6 +226,29 @@ class RenameJoin end end +class PartlyQualifiedCombo + include Bud + state do + table :arr + table :ess + table :tee + table :result + end + + bootstrap do + arr << [1, 2] + ess << [1, 3] + tee << [5, 6] + end + + bloom do + # result is never populated + result <= (tee * arr * ess).combos(arr.key => ess.key) + # but it is when the join is specified in this order + #result <= (arr * ess * tee).combos(arr.key => ess.key) + end +end + class TestJoins < Test::Unit::TestCase def test_combos program = CombosBud.new @@ -320,4 +343,10 @@ class TestJoins < Test::Unit::TestCase assert_nothing_raised(RuntimeError) {p.tick} assert_equal([['a', 1]], p.out.to_a) end + + def test_partial_combos + p = PartlyQualifiedCombo.new + p.tick + assert_equal(1, p.result.length) + end end
test case for infix + combos + xproduct
bloom-lang_bud
train
rb
13043b66c007b7b9381f9c550aa436fee2fe490f
diff --git a/modules/page/html/render/message.js b/modules/page/html/render/message.js index <HASH>..<HASH> 100644 --- a/modules/page/html/render/message.js +++ b/modules/page/html/render/message.js @@ -33,7 +33,7 @@ exports.create = function (api) { type: 'post', root: Proxy(id), branch: Proxy(id), - reply: Value(undefined), + reply: Proxy(undefined), channel: Value(undefined), recps: Value(undefined) }) @@ -78,7 +78,21 @@ exports.create = function (api) { meta.root.set(root || thread.rootId) // track message author for resolving missing messages and reply mentions - meta.reply.set({[id]: author}) + meta.reply.set(computed(thread.messages, messages => { + var result = {} + var first = messages[0] + var last = messages[messages.length - 1] + + if (first && first.value) { + result[messages[0].key] = messages[0].value.author + } + + if (last && last !== first && last.value) { + result[last.key] = last.value.author + } + + return result + })) // if root thread, reply to last post meta.branch.set(isReply ? thread.branchId : thread.lastId)
correctly track reply authors of most recent and root post
ssbc_patchwork
train
js
7a3e967697b824e13080e92b9b9e0fec2460cfaf
diff --git a/packages/ember-metal/lib/injected_property.js b/packages/ember-metal/lib/injected_property.js index <HASH>..<HASH> 100644 --- a/packages/ember-metal/lib/injected_property.js +++ b/packages/ember-metal/lib/injected_property.js @@ -23,9 +23,9 @@ function InjectedProperty(type, name) { } function injectedPropertyGet(keyName) { - var possibleDesc = this[keyName]; - var desc = (possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor) ? possibleDesc : undefined; + var desc = this[keyName]; + Ember.assert(`InjectedProperties should be defined with the Ember.inject computed property macros.`, desc && desc.isDescriptor && desc.type); Ember.assert(`Attempting to lookup an injected property on an object without a container, ensure that the object was instantiated via a container.`, this.container); return this.container.lookup(desc.type + ':' + (desc.name || keyName));
[BUGFIX beta] improve errors when InjectedProperty is misused Previously, if InjectedProperty was created improperly, it would fail with an obtuse "undefined has no property type" error. This introduces an assertion to improve the readability of that error case.
emberjs_ember.js
train
js
b4a4c0e38dd9a02aac956d726655bb3591db3b3b
diff --git a/serverlessrepo/__version__.py b/serverlessrepo/__version__.py index <HASH>..<HASH> 100644 --- a/serverlessrepo/__version__.py +++ b/serverlessrepo/__version__.py @@ -1,7 +1,7 @@ """Serverlessrepo version and package meta-data.""" __title__ = 'serverlessrepo' -__version__ = '0.1.0' +__version__ = '0.1.1' __license__ = 'Apache 2.0' __description__ = ( 'A Python library with convenience helpers for working '
Change version number (#<I>)
awslabs_aws-serverlessrepo-python
train
py
20c0da08ed7f3a49ea166a21972cde6489b5a55a
diff --git a/findbugs/src/java/edu/umd/cs/findbugs/detect/SerializableIdiom.java b/findbugs/src/java/edu/umd/cs/findbugs/detect/SerializableIdiom.java index <HASH>..<HASH> 100644 --- a/findbugs/src/java/edu/umd/cs/findbugs/detect/SerializableIdiom.java +++ b/findbugs/src/java/edu/umd/cs/findbugs/detect/SerializableIdiom.java @@ -428,7 +428,7 @@ public class SerializableIdiom extends BytecodeScanningDetector fieldWarningList.add(new BugInstance(this, "SE_BAD_FIELD_STORE", priority).addClass( getThisClass().getClassName()).addField(f) - .addClass(classStored).addSourceLine(this)); + .addType(genSig).describe("TYPE_FOUND").addSourceLine(this)); } } } catch (Exception e) {
annotate with a described type rather than a class git-svn-id: <URL>
spotbugs_spotbugs
train
java
d1ca218a1e4cb69f24d3d89908b3ef6c0954192e
diff --git a/modules/activiti-engine/src/main/java/org/activiti/engine/impl/persistence/entity/ExecutionEntityManagerImpl.java b/modules/activiti-engine/src/main/java/org/activiti/engine/impl/persistence/entity/ExecutionEntityManagerImpl.java index <HASH>..<HASH> 100644 --- a/modules/activiti-engine/src/main/java/org/activiti/engine/impl/persistence/entity/ExecutionEntityManagerImpl.java +++ b/modules/activiti-engine/src/main/java/org/activiti/engine/impl/persistence/entity/ExecutionEntityManagerImpl.java @@ -215,6 +215,8 @@ public class ExecutionEntityManagerImpl extends AbstractEntityManager<ExecutionE processInstanceExecution.setProcessDefinitionId(processDefinition.getId()); processInstanceExecution.setProcessDefinitionKey(processDefinition.getKey()); + processInstanceExecution.setProcessDefinitionName(processDefinition.getName()); + processInstanceExecution.setProcessDefinitionVersion(processDefinition.getVersion()); processInstanceExecution.setBusinessKey(businessKey); processInstanceExecution.setScope(true); // process instance is always a scope for all child executions
added code to get procdef name and version
Activiti_Activiti
train
java
b078324d5e911ec5e667736b2c552af32f475751
diff --git a/lib/runAll.js b/lib/runAll.js index <HASH>..<HASH> 100644 --- a/lib/runAll.js +++ b/lib/runAll.js @@ -119,6 +119,7 @@ const runAll = async ( ctx, exitOnError: false, nonTTYRenderer: 'verbose', + registerSignalListeners: false, ...getRenderer({ debug, quiet }), } diff --git a/test/index2.spec.js b/test/index2.spec.js index <HASH>..<HASH> 100644 --- a/test/index2.spec.js +++ b/test/index2.spec.js @@ -33,6 +33,7 @@ describe('lintStaged', () => { }, "exitOnError": false, "nonTTYRenderer": "verbose", + "registerSignalListeners": false, "renderer": "silent", } `) @@ -58,6 +59,7 @@ describe('lintStaged', () => { }, "exitOnError": false, "nonTTYRenderer": "verbose", + "registerSignalListeners": false, "renderer": "verbose", } `)
fix: canceling lint-staged via SIGINT restores state and cleans up (#<I>) When replacing listr with listr2, this was a change in default behaviour that was left unnoticed
okonet_lint-staged
train
js,js
e3d2d7091a237a6d5e1a5c52e17dd9242b7e6f3f
diff --git a/wdb/__init__.py b/wdb/__init__.py index <HASH>..<HASH> 100644 --- a/wdb/__init__.py +++ b/wdb/__init__.py @@ -41,7 +41,7 @@ BASE_PATH = os.path.join( RES_PATH = os.path.join(BASE_PATH, 'resources') log = get_color_logger('wdb') -log.setLevel(10) +log.setLevel(30) class WdbOff(Exception): @@ -343,6 +343,7 @@ class Wdb(object): # Let's make a server wdbr = Wdb.make_server() else: + sys.settrace(None) log.info('Tracing with an existing server') wdbr.reset() wdbr.stop_trace() @@ -350,7 +351,10 @@ class Wdb(object): def trace(frame, event, arg): rv = wdbr.trace_dispatch(frame, event, arg) - if rv is None and not full: + if (rv is None and not + full and not + frame.f_code.co_filename.startswith( + os.path.dirname(os.path.abspath(sys.argv[0])))): return return trace
Try another strategy for breaking on exceptions
Kozea_wdb
train
py
6117ca3235ee74ae8d0d89c14a570efbd15bb5b7
diff --git a/src/Dami/Cli/Command/StatusCommand.php b/src/Dami/Cli/Command/StatusCommand.php index <HASH>..<HASH> 100644 --- a/src/Dami/Cli/Command/StatusCommand.php +++ b/src/Dami/Cli/Command/StatusCommand.php @@ -8,8 +8,6 @@ use Symfony\Component\Console\Input\InputArgument, Symfony\Component\Console\Input\InputInterface, Symfony\Component\Console\Output\OutputInterface; -use Dami\Migration\MigrationFiles; - class StatusCommand extends ContainerAwareCommand { protected function configure() @@ -31,9 +29,8 @@ class StatusCommand extends ContainerAwareCommand $rows[] = array($status, $migrationFile->getVersion(), $migrationFile->getName()); } if (count($rows) > 0) { - $table = $this->getHelperSet()->get('table'); - $table - ->setHeaders(array('Status', 'Version', 'Name')) + (new Console\Helper\Table($output)) + ->setHeaders(['Status', 'Version', 'Name']) ->setRows($rows) ->render($output); } else {
Support for new sf api
czogori_Dami
train
php
99433e4d6d8f5e879a4f9e209b2cb38bc5de2286
diff --git a/message/output/jabber/message_output_jabber.php b/message/output/jabber/message_output_jabber.php index <HASH>..<HASH> 100644 --- a/message/output/jabber/message_output_jabber.php +++ b/message/output/jabber/message_output_jabber.php @@ -73,6 +73,9 @@ class message_output_jabber extends message_output { $conn = new XMPPHP_XMPP($CFG->jabberhost,$CFG->jabberport,$CFG->jabberusername,$CFG->jabberpassword,'moodle',$CFG->jabberserver); + // No need to track the presence during the sending message process. + $conn->track_presence = false; + try { //$conn->useEncryption(false); $conn->connect();
MDL-<I> message: Prevent notice when sending Jabber messages Not tracking the presence prevents a notice to be displayed during disconnect(), where the the jabber server attempts to subscribe to $CFG->jabberusername presence. As the server name does not include a resource identifier (<EMAIL>/resource), an explode('/') fails.
moodle_moodle
train
php
89ee5aaed4f9330c0513aea0982cd5f5dd7d71e7
diff --git a/wal/wal.go b/wal/wal.go index <HASH>..<HASH> 100644 --- a/wal/wal.go +++ b/wal/wal.go @@ -296,7 +296,7 @@ func (w *WAL) Repair(origErr error) error { if err != nil { return errors.Wrap(err, "list segments") } - level.Warn(w.logger).Log("msg", "deleting all segments behind corruption", "segment", cerr.Segment) + level.Warn(w.logger).Log("msg", "deleting all segments newer than corrupted segment", "segment", cerr.Segment) for _, s := range segs { if w.segment.i == s.index {
clarify which segments are deleted when we find a corrupted segment (#<I>)
prometheus_prometheus
train
go
1700035537aac40e0efcdc7bb56ad56b01918535
diff --git a/lib/Tmdb/Model/Common/People/PersonInterface.php b/lib/Tmdb/Model/Common/People/PersonInterface.php index <HASH>..<HASH> 100644 --- a/lib/Tmdb/Model/Common/People/PersonInterface.php +++ b/lib/Tmdb/Model/Common/People/PersonInterface.php @@ -14,4 +14,5 @@ namespace Tmdb\Model\Common\People; interface PersonInterface { function getName(); + function getId(); } \ No newline at end of file
Adding getId to the Person Interface to make sure it is always compatible.
php-tmdb_api
train
php
2c39057c4a6f5623ed8566ed4d0e8d75d93e4ba1
diff --git a/test/test_helper.rb b/test/test_helper.rb index <HASH>..<HASH> 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -10,10 +10,9 @@ require 'byebug' $LOAD_PATH << File.dirname(__FILE__) + '/../lib/' require 'oauth' require 'stringio' -require 'webmock' +require 'webmock/minitest' -class Minitest::Test - include WebMock::API +Minitest::Test.class_eval do def assert_matching_headers(expected, actual) # transform into sorted arrays
fix #<I> - Adjusting to webmock latest recommended implementation for minitest
oauth-xx_oauth-ruby
train
rb
f10f44acf5e070faf06eb43f6a9d00a7fe73f977
diff --git a/script/lib/utils.js b/script/lib/utils.js index <HASH>..<HASH> 100644 --- a/script/lib/utils.js +++ b/script/lib/utils.js @@ -49,7 +49,7 @@ async function getCurrentBranch (gitDir) { '--remote' ], gitDir)).split('\n') - branch = branches.filter(b => b === 'master' || b.match(/[0-9]+-[0-9]+-x/))[0] + branch = branches.filter(b => b.trim() === 'master' || b.match(/[0-9]+-[0-9]+-x/))[0] if (!branch) { console.log(`${fail} no release branch exists for this ref`) process.exit(1)
fix: trim branch name before comparing to master (#<I>)
electron_electron
train
js
6b0305d4e09f9eba13720178684dcd23202d88dd
diff --git a/lib/ponse.js b/lib/ponse.js index <HASH>..<HASH> 100644 --- a/lib/ponse.js +++ b/lib/ponse.js @@ -15,10 +15,7 @@ OK = 200, RANGE = 206, MOVED_PERMANENTLY = 301, - FILE_NOT_FOUND = 404, - - REQUEST = 'request', - RESPONSE = 'response'; + FILE_NOT_FOUND = 404; exports.redirect = redirect;
chore(ponse) rm REQUEST, RESPONSE
coderaiser_ponse
train
js
792c32dc164037dd3d0bcf2b61d3cb6ebd1fea74
diff --git a/src/utils.js b/src/utils.js index <HASH>..<HASH> 100644 --- a/src/utils.js +++ b/src/utils.js @@ -110,6 +110,7 @@ export function objectComparison(first, second) { return (function eq(f, s) { if (f === s) return true; // сравниваем обычным образом if (f instanceof Date && s instanceof Date) return +f === +s; // время + if (typeof f === 'function' && typeof s === 'function') return true; // функции не сравниваем if (typeof f !== 'object' || typeof s !== 'object') return false; // если хотябы один из аргументов не объект (положительный случай для необъектов рассмотрен выше) if (inCache(f, s)) return true; // есть в кеше cache.push([f, s]); // кешируем
For #<I>: don't compare functions values in objectComparison
PNKBizz_vue-yandex-map
train
js
500c4346f4f775daf9b378d97fa54163aba83c15
diff --git a/lib/thinking_sphinx/active_record/sql_source.rb b/lib/thinking_sphinx/active_record/sql_source.rb index <HASH>..<HASH> 100644 --- a/lib/thinking_sphinx/active_record/sql_source.rb +++ b/lib/thinking_sphinx/active_record/sql_source.rb @@ -126,7 +126,8 @@ class ThinkingSphinx::ActiveRecord::SQLSource < Riddle::Configuration::SQLSource def set_database_settings @sql_host ||= database_settings[:host] || 'localhost' - @sql_user ||= database_settings[:username] || database_settings[:user] + @sql_user ||= database_settings[:username] || database_settings[:user] || + ENV['USER'] @sql_pass ||= database_settings[:password].to_s.gsub('#', '\#') @sql_db ||= database_settings[:database] @sql_port ||= database_settings[:port]
Use environment username if no database user is specified.
pat_thinking-sphinx
train
rb
41b64eb4ff710ccdbfcc12598a7591c30204bfaa
diff --git a/eZ/Bundle/EzPublishLegacyBundle/EzPublishLegacyBundle.php b/eZ/Bundle/EzPublishLegacyBundle/EzPublishLegacyBundle.php index <HASH>..<HASH> 100644 --- a/eZ/Bundle/EzPublishLegacyBundle/EzPublishLegacyBundle.php +++ b/eZ/Bundle/EzPublishLegacyBundle/EzPublishLegacyBundle.php @@ -17,15 +17,10 @@ class EzPublishLegacyBundle extends Bundle { public function boot() { - if ( $this->container->getParameter( 'ezpublish_legacy.enabled' ) ) - { - // To properly register legacy autoload, we need to go to the legacy root dir - // since legacy autoload.php has some dependencies on files called with relative paths (i.e. config.php) - $workingDir = getcwd(); - chdir( $this->container->getParameter( 'ezpublish_legacy.root_dir' ) ); - require_once "autoload.php"; - chdir( $workingDir ); - } + if ( !$this->container->getParameter( 'ezpublish_legacy.enabled' ) ) + return; + + require_once $this->container->getParameter( 'ezpublish_legacy.root_dir' ) . "/autoload.php"; } }
Changed: simplified EzPublishLegacyBundle::boot() a bit
ezsystems_ezpublish-kernel
train
php
308fd0fe70f198580929ac6d0a966c1edb4c3f99
diff --git a/plugin/distributed/distributed.go b/plugin/distributed/distributed.go index <HASH>..<HASH> 100644 --- a/plugin/distributed/distributed.go +++ b/plugin/distributed/distributed.go @@ -40,11 +40,11 @@ type GetQueriesFunc func(ctx context.Context) (*GetQueriesResult, error) // Result contains the status and results for a distributed query. type Result struct { // QueryName is the name that was originally provided for the query. - QueryName string + QueryName string `json:"query_name"` // Status is an integer status code for the query execution (0 = OK) - Status int + Status int `json:"status"` // Rows is the result rows of the query. - Rows []map[string]string + Rows []map[string]string `json:"rows"` } // WriteResultsFunc writes the results of the executed distributed queries. The
add json tags to distributed results (#<I>)
kolide_osquery-go
train
go
6a4f7de80200c90b5934a5532fa709a02a36d098
diff --git a/osmdroid-android/src/main/java/org/osmdroid/views/overlay/mylocation/MyLocationNewOverlay.java b/osmdroid-android/src/main/java/org/osmdroid/views/overlay/mylocation/MyLocationNewOverlay.java index <HASH>..<HASH> 100644 --- a/osmdroid-android/src/main/java/org/osmdroid/views/overlay/mylocation/MyLocationNewOverlay.java +++ b/osmdroid-android/src/main/java/org/osmdroid/views/overlay/mylocation/MyLocationNewOverlay.java @@ -170,14 +170,13 @@ public class MyLocationNewOverlay extends Overlay implements IMyLocationConsumer protected void drawMyLocation(final Canvas canvas, final MapView mapView, final Location lastFix) { final Projection pj = mapView.getProjection(); + pj.toPixelsTranslated(mMapCoordsProjected, mMapCoordsTranslated); if (mDrawAccuracyEnabled) { final float radius = lastFix.getAccuracy() / (float) TileSystem.GroundResolution(lastFix.getLatitude(), mapView.getZoomLevel()); - pj.toPixelsTranslated(mMapCoordsProjected, mMapCoordsTranslated); - mCirclePaint.setAlpha(50); mCirclePaint.setStyle(Style.FILL); canvas.drawCircle(mMapCoordsTranslated.x, mMapCoordsTranslated.y, radius, mCirclePaint);
Move toPixelsTranslated to better location
osmdroid_osmdroid
train
java
849301b7e09e437ba1a515cb4418c170f4e68f14
diff --git a/rundeckapp/web-app/js/yellowfade.js b/rundeckapp/web-app/js/yellowfade.js index <HASH>..<HASH> 100644 --- a/rundeckapp/web-app/js/yellowfade.js +++ b/rundeckapp/web-app/js/yellowfade.js @@ -52,7 +52,7 @@ function yellowfade(id,perc,time,rate,ramp,test,rgb1,rgb2){ if(test){ $(id).innerHTML+=", newperc: "+newperc+", newramp: "+newramp+", delay: "+(1000/rate) ; } - var tostr = "yellowfade('"+id+"',"+newperc+","+time+","+rate+","+newramp+", "+test+",new Array("+rgbstart[0]+","+rgbstart[1]+","+rgbstart[2]+"),new Array("+rgbend[0]+","+rgbend[1]+","+rgbend[2]+"));"; + var tostr = "yellowfade('"+ $(id).identify()+"',"+newperc+","+time+","+rate+","+newramp+", "+test+",new Array("+rgbstart[0]+","+rgbstart[1]+","+rgbstart[2]+"),new Array("+rgbend[0]+","+rgbend[1]+","+rgbend[2]+"));"; if(test){ $(id).innerHTML+="<br>"+tostr; }
Fix yellowfade function bug when passed id is object
rundeck_rundeck
train
js
ac487f47b8c6da56d7721a8886883393272b94b4
diff --git a/src/main/java/com/github/alexcojocaru/mojo/elasticsearch/v2/client/Monitor.java b/src/main/java/com/github/alexcojocaru/mojo/elasticsearch/v2/client/Monitor.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/github/alexcojocaru/mojo/elasticsearch/v2/client/Monitor.java +++ b/src/main/java/com/github/alexcojocaru/mojo/elasticsearch/v2/client/Monitor.java @@ -45,7 +45,7 @@ public class Monitor } } ); - log.debug("Elasticsearch instance has started"); + log.info("Elasticsearch instance has started"); } /** @@ -121,7 +121,7 @@ public class Monitor } } ); - log.debug("Elasticsearch cluster has started"); + log.info("Elasticsearch cluster has started"); } /**
change the log level on some of the log messages
alexcojocaru_elasticsearch-maven-plugin
train
java
3af8dc76d157f560d28856bd2d4be4a1c9a8c7d1
diff --git a/lib/data_mapper/relation/header/attribute_index.rb b/lib/data_mapper/relation/header/attribute_index.rb index <HASH>..<HASH> 100644 --- a/lib/data_mapper/relation/header/attribute_index.rb +++ b/lib/data_mapper/relation/header/attribute_index.rb @@ -183,7 +183,7 @@ module DataMapper def renamed_attributes(aliases) with_new_entries(aliases) { |from, to, renamed| - with_initial_attributes(from) do |initial| + with_initial_attributes(from) do |initial, *| renamed[initial] = new_attribute(to, initial.prefix) end }
Fix unit spec failures on <I> The 2nd block param was removed before to make mutant happy. Changing the 2nd block param to * instead of _current still satisfies mutant, while at the same time working with <I> too
rom-rb_rom
train
rb
fccb8e8bc723d577cde1f2c503520d47617ab5f3
diff --git a/tests/InvoiceTest.php b/tests/InvoiceTest.php index <HASH>..<HASH> 100644 --- a/tests/InvoiceTest.php +++ b/tests/InvoiceTest.php @@ -71,6 +71,18 @@ class InvoiceTest extends PHPUnit_Framework_TestCase /** * @test */ + public function weCanGetTheCustomerForANewInvoice() + { + $includingTaxInvoice = $this->getNewInvoice(IncludingTaxInvoice::class); + $excludingTaxInvoice = $this->getNewInvoice(ExcludingTaxInvoice::class); + + $this->assertEquals($includingTaxInvoice->getCustomer(), $this->customer); + $this->assertEquals($excludingTaxInvoice->getCustomer(), $this->customer); + } + + /** + * @test + */ public function itCreatesAnInvoiceWithOTotal() { $includingTaxInvoice = $this->getNewInvoice(IncludingTaxInvoice::class);
test: getter for the customer of an invoice Check if we can get the customer of an invoice
QuanticTelecom_invoices
train
php
35841708003ba45317d33e2fc8b58a61ebc1c66d
diff --git a/sdk/python/lib/test/automation/test_errors.py b/sdk/python/lib/test/automation/test_errors.py index <HASH>..<HASH> 100644 --- a/sdk/python/lib/test/automation/test_errors.py +++ b/sdk/python/lib/test/automation/test_errors.py @@ -56,7 +56,8 @@ class TestErrors(unittest.TestCase): subprocess.run(["npm", "install"], check=True, cwd=project_dir, capture_output=True) if lang == "python": subprocess.run(["python3", "-m", "venv", "venv"], check=True, cwd=project_dir, capture_output=True) - subprocess.run([os.path.join("venv", "bin", "pip"), "install", "-r", "requirements.txt"], + subprocess.run([os.path.join("venv", "bin", "python"), + "-m", "pip", "install", "-r", "requirements.txt"], check=True, cwd=project_dir, capture_output=True) stack = create_stack(stack_name, work_dir=project_dir)
Fix pip not found error (#<I>)
pulumi_pulumi
train
py
884f7b786414127573888ace813a2bcc058f68a9
diff --git a/lib/config.js b/lib/config.js index <HASH>..<HASH> 100644 --- a/lib/config.js +++ b/lib/config.js @@ -625,6 +625,7 @@ exports.extend = function(newConf) { }; // node 11及以上版本缓存连接有问题,先禁掉 disableAgent = disableAgent || config.debug; + config.disableAgent = disableAgent; config.httpAgent = disableAgent ? false : createAgent(agentConfig); config.httpsAgent = disableAgent ? false : createAgent(agentConfig, true); config.getSocksAgent = function(options) { diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -39,7 +39,7 @@ function proxy(callback) { .concat(require('./inspectors')) .concat(config.middlewares) .concat(require('./handlers')); - server.keepAliveTimeout = 0; + server.keepAliveTimeout = config.disableAgent ? 1 : 0; server.timeout = 0; proxyEvents.config = config; proxyEvents.server = server;
refactor: keepAliveTimeout
avwo_whistle
train
js,js
204b4e294f552487778f3ecc7e97306a8a6fc851
diff --git a/tests/test_customer_mandates.py b/tests/test_customer_mandates.py index <HASH>..<HASH> 100644 --- a/tests/test_customer_mandates.py +++ b/tests/test_customer_mandates.py @@ -107,3 +107,14 @@ def test_update_customer_mandate(client, response): mandate = client.customer_mandates.with_parent_id(CUSTOMER_ID).update(MANDATE_ID, data=data) assert isinstance(mandate, Mandate) assert mandate.id == MANDATE_ID + + +def test_revoke_customer_mandate(client, response): + response.delete( + 'https://api.mollie.com/v2/customers/%s/mandates/%s' % (CUSTOMER_ID, MANDATE_ID), + 'empty', + 204 + ) + + resp = client.customer_mandates.with_parent_id(CUSTOMER_ID).delete(MANDATE_ID) + assert resp == {}
Add test for revoking a customer mandate
mollie_mollie-api-python
train
py
e7b8c646b18c70acc4e68929322a4e33d408bd7c
diff --git a/test/unit/conftest.py b/test/unit/conftest.py index <HASH>..<HASH> 100644 --- a/test/unit/conftest.py +++ b/test/unit/conftest.py @@ -212,6 +212,9 @@ def docker_v1_section_data(): }, { 'name': 'test2', 'image': 'ubuntu', + 'links': { + 'test1': '80', + }, 'image_version': 'latest', 'ansible_groups': ['group2'], 'command': '/bin/sh',
add links config to test2 container
ansible_molecule
train
py