A day in the life of a bug fix
Pete Bacon Darwin
(Closed Source proprietary API)
(Comic by Nina Paley / CC By-SA 3.0)
more than 1200 contributors
By Nevit Dilmen (Own work) [CC BY-SA 3.0]
900+ outstanding issues
300+ outstanding PRs
https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md
Identify the bug
Post an issue
Fix the problem
Submit a pull request
Deal with feedback
Bask in the glory of being a super hero contributor
ngOptions incorrectly evaluates label for $$hashKey when watching labels
https://github.com/angular/angular.js/issues/11930
1.3.x ngCookies service overwrites/duplicates cookies set outside of ngCookies
npm install -g grunt
git clone https://github.com/petebacondarwin/angular.js
npm install
grunt package
git checkout -b issue-11930
grunt autotest
it('should not watch array properties that start with $ or $$', function() {
createSelect({
'ng-options': 'value as createLabel(value) for value in array',
'ng-model': 'selected'
});
scope.createLabel = jasmine.createSpy()
.andCallFake(function(value) { return value; });
scope.array = ['a', 'b', 'c'];
scope.array.$$private = 'do not watch';
scope.array.$property = 'do not watch';
scope.selected = 'b';
scope.$digest();
expect(scope.createLabel).toHaveBeenCalledWith('a');
expect(scope.createLabel).toHaveBeenCalledWith('b');
expect(scope.createLabel).toHaveBeenCalledWith('c');
expect(scope.createLabel).not.toHaveBeenCalledWith('do not watch');
});
Object.keys(values).forEach(function getWatchable(key) {
if (key.charAt(0) === '$') return;
var locals = getLocals(values[key], key);
var selectValue = getTrackByValueFn(values[key], locals);
watchedArray.push(selectValue);
// Only need to watch the displayFn if there is a specific label expression
if (match[2] || match[1]) {
var label = displayFn(scope, locals);
watchedArray.push(label);
}
// Only need to watch the disableWhenFn if there is a specific disable expression
if (match[4]) {
var disableWhen = disableWhenFn(scope, locals);
watchedArray.push(disableWhen);
}
});
grunt test
This is equivalent to
grunt ci-checks grunt package grunt test:unit grunt test:e2e
Sign the CLA
https://cla.developers.google.com/about/google-individual?csw=1
Write a good commit message
Push to your fork
Create pull request
Check solution passes on Travis
fix(ngOptions): do not watch properties starting with $
Expressions that compute labels and track by values for ngOptions were being called for properties, that start with $ even though those properties were being ignored as options.
Closes #11930
Push to your fork
git push -u origin/issue-11930
Subscribe to notifications for the issue and PR
Add new commits (no need to squash or force push)
Sit back and basque in contribution glory
Watch out for related regressions appearing in issues