team_api 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +68 -28
- data/lib/team_api/cross_reference_data.rb +10 -5
- data/lib/team_api/cross_referencer.rb +15 -2
- data/lib/team_api/joiner.rb +2 -1
- data/lib/team_api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf53595241cc4fe02b10a666a10f9f3ab5ca8389
|
4
|
+
data.tar.gz: a1bf4c5f116949067db9fb6c661f552ee958d455
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01198398379e2c70866c6face0ef88b760fe86f515b97672571d16c40a2075b342bea5ee156b5304c547d68275f4c40947a423c94135b9df364dc74c761a4567
|
7
|
+
data.tar.gz: 9e3d039c425ad69a4d96d253c87aaaf542088a887ad5476543eab2c0db407ec5b7992c23f00b9834ad3869d87535a7a95cba60310af1c4fffe72fab65c1f3799
|
data/CONTRIBUTING.md
CHANGED
@@ -1,14 +1,5 @@
|
|
1
1
|
## Welcome!
|
2
2
|
|
3
|
-
### Code of conduct
|
4
|
-
|
5
|
-
We aspire to create a welcoming environment for collaboration on this project.
|
6
|
-
To that end, we follow the [18F Code of
|
7
|
-
Conduct](https://github.com/18F/code-of-conduct/blob/master/code-of-conduct.md)
|
8
|
-
and ask that all contributors do the same.
|
9
|
-
|
10
|
-
### Getting started
|
11
|
-
|
12
3
|
We're so glad you're thinking about contributing to an 18F open source project!
|
13
4
|
If you're unsure or afraid of anything, just ask or submit the issue or pull
|
14
5
|
request anyways. The worst that can happen is that you'll be politely asked to
|
@@ -16,25 +7,13 @@ change something. We appreciate any sort of contribution, and don't want a wall
|
|
16
7
|
of rules to get in the way of that.
|
17
8
|
|
18
9
|
Before contributing, we encourage you to read our CONTRIBUTING policy (you are
|
19
|
-
here), our
|
20
|
-
questions, or want to read more about our underlying policies,
|
21
|
-
the
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
1. Fork the repository or create a branch if you are part of the 18F Team on
|
28
|
-
GitHub
|
29
|
-
2. Implement your feature or bug fix (and add test coverage if applicable)
|
30
|
-
3. Run the tests (`$ ./go test`) to make sure nothing is broken
|
31
|
-
4. Add, commit, and push your changes
|
32
|
-
5. [Submit a pull
|
33
|
-
request](https://help.github.com/articles/using-pull-requests/)
|
34
|
-
6. Another contributor will merge your pull request into master when it is deemed
|
35
|
-
ready
|
36
|
-
|
37
|
-
### Public domain
|
10
|
+
here), our LICENSE, and our README, all of which should be in this repository.
|
11
|
+
If you have any questions, or want to read more about our underlying policies,
|
12
|
+
you can consult the 18F Open Source Policy GitHub repository at
|
13
|
+
https://github.com/18f/open-source-policy, or just shoot us an email/official
|
14
|
+
government letterhead note to [18f@gsa.gov](mailto:18f@gsa.gov).
|
15
|
+
|
16
|
+
## Public domain
|
38
17
|
|
39
18
|
This project is in the public domain within the United States, and
|
40
19
|
copyright and related rights in the work worldwide are waived through
|
@@ -43,3 +22,64 @@ the [CC0 1.0 Universal public domain dedication](https://creativecommons.org/pub
|
|
43
22
|
All contributions to this project will be released under the CC0
|
44
23
|
dedication. By submitting a pull request, you are agreeing to comply
|
45
24
|
with this waiver of copyright interest.
|
25
|
+
|
26
|
+
## Starting work on an issue
|
27
|
+
|
28
|
+
Issues that are marked with the `ready` label are ripe for the picking! Simply
|
29
|
+
assign yourself to the issue to and change its label to `in progress` to
|
30
|
+
indicate that you are working on it.
|
31
|
+
|
32
|
+
If the issue involves writing code or producing some other change that will
|
33
|
+
result in a pull request, begin by creating yourself a branch with a short
|
34
|
+
descriptive name of the work that includes the issue number at the end, e.g.,
|
35
|
+
`document-pr-process-#36`.
|
36
|
+
|
37
|
+
**Note:** If you are not a part of the 18F Team, please fork the repository
|
38
|
+
first and then create a branch for yourself with the same convention.
|
39
|
+
|
40
|
+
Once your local branch is created, simply push it remotely and this will
|
41
|
+
assign the issue to you and move it to be `in progress` automatically.
|
42
|
+
|
43
|
+
## Submitting a pull request and completing work
|
44
|
+
|
45
|
+
When you are satisfied with your work and ready to submit it to be completed,
|
46
|
+
please submit a pull request for review. If you haven't already, please
|
47
|
+
follow the instructions above and create a branch for yourself first. Prior
|
48
|
+
to submitting the pull request, please make note of the following:
|
49
|
+
|
50
|
+
1. Code changes should be accompanied by tests.
|
51
|
+
2. Please run the tests (`$ ./go test`) to make sure there are no regressions.
|
52
|
+
|
53
|
+
Once everything is ready to go, [submit your pull request](https://help.github.com/articles/using-pull-requests/)!
|
54
|
+
When creating a pull request please be sure to reference the issue number it
|
55
|
+
is associated with, preferably in the title.
|
56
|
+
|
57
|
+
If you are working in a branch off of the 18F/team_api repo directly, you can
|
58
|
+
reference the issue like this:
|
59
|
+
`Closes #45: Short sentence describing the pull request`
|
60
|
+
|
61
|
+
If you are working in a forked copy of the repo, please reference the issue
|
62
|
+
like this:
|
63
|
+
`Closes 18F/team_api#45: Short sentence describing the pull request`
|
64
|
+
|
65
|
+
In both cases, please include a descriptive summary of the change in the body
|
66
|
+
of the pull request as that will help greatly in reviewing the change and
|
67
|
+
understanding what should be taking place inside of it.
|
68
|
+
|
69
|
+
By referencing the issue in the pull request as noted above, this will
|
70
|
+
automatically update the issue with a `needs review` label and notify the
|
71
|
+
collaborators on the project that something is ready for a review. One of us
|
72
|
+
will take a look as soon as we can and initiate the review process, provide
|
73
|
+
feedback as necessary, and ultimately merge the change.
|
74
|
+
|
75
|
+
Once the code is merged, the branch will be deleted and the `in review`
|
76
|
+
label will be removed. The issue will be automatically updated again to be
|
77
|
+
marked as Done and Closed.
|
78
|
+
|
79
|
+
## Performing a review of a pull request
|
80
|
+
|
81
|
+
If you are performing a review of a pull request please add the `in review`
|
82
|
+
label to the pull request and be sure keep the `needs review` label
|
83
|
+
associated with it. This will help keep our Waffle board up-to-date and
|
84
|
+
reflect that the pull request is being actively reviewed. Also, please
|
85
|
+
assign yourself so others know who the primary reviewer is.
|
@@ -55,27 +55,32 @@ module TeamApi
|
|
55
55
|
# @param source_to_target_field [String] if specified, the field from this
|
56
56
|
# collection's objects that contain identifiers of objects stored within
|
57
57
|
# target; if not specified, target.collection_name will be used instead
|
58
|
-
def create_xrefs(target, source_to_target_field: nil)
|
58
|
+
def create_xrefs(target, source_to_target_field: nil, alternate_names: nil)
|
59
|
+
item_xref_fields << 'deprecated_name'
|
60
|
+
|
59
61
|
target_collection_field = source_to_target_field || target.collection_name
|
60
62
|
data.values.each do |source|
|
61
|
-
create_xrefs_for_source source, target_collection_field, target
|
63
|
+
create_xrefs_for_source source, target_collection_field, target, alternate_names
|
62
64
|
end
|
63
65
|
target.data.values.each { |item| (item[collection_name] || []).uniq! }
|
64
66
|
end
|
65
67
|
|
66
68
|
private
|
67
69
|
|
68
|
-
def create_xrefs_for_source(source, target_collection_field, target)
|
70
|
+
def create_xrefs_for_source(source, target_collection_field, target, alternate_names)
|
69
71
|
source_xref = item_to_xref source
|
70
|
-
target_ids = filter_target_ids target, source, target_collection_field
|
72
|
+
target_ids = filter_target_ids target, source, target_collection_field, alternate_names
|
71
73
|
link_source_to_targets source_xref, target_ids, target
|
72
74
|
source[target_collection_field] = target_xrefs target, target_ids
|
73
75
|
end
|
74
76
|
|
75
|
-
def filter_target_ids(target_xref, source_item, target_collection_field)
|
77
|
+
def filter_target_ids(target_xref, source_item, target_collection_field, alternate_names)
|
76
78
|
(source_item[target_collection_field] || []).map do |target_id|
|
77
79
|
if target_xref.data.member? target_id
|
78
80
|
target_id
|
81
|
+
elsif alternate_names && alternate_names[target_id] &&
|
82
|
+
(target_xref.data.member? alternate_names[target_id])
|
83
|
+
alternate_names[target_id]
|
79
84
|
elsif !public_mode
|
80
85
|
fail UnknownCrossReferenceTargetId, unknown_cross_reference_msg(
|
81
86
|
collection_name, source_item, target_collection_field,
|
@@ -23,9 +23,13 @@ module TeamApi
|
|
23
23
|
team, projects, working_groups, guilds = create_xref_data site
|
24
24
|
|
25
25
|
projects.create_xrefs team
|
26
|
+
name_xrefs = create_name_xrefs team
|
27
|
+
|
26
28
|
[working_groups, guilds].each do |grouplet|
|
27
|
-
grouplet.create_xrefs team, source_to_target_field: 'leads'
|
28
|
-
|
29
|
+
grouplet.create_xrefs team, source_to_target_field: 'leads',
|
30
|
+
alternate_names: name_xrefs
|
31
|
+
grouplet.create_xrefs team, source_to_target_field: 'members',
|
32
|
+
alternate_names: name_xrefs
|
29
33
|
end
|
30
34
|
|
31
35
|
xref_tags_and_team_members site, TAG_CATEGORIES, team
|
@@ -41,6 +45,15 @@ module TeamApi
|
|
41
45
|
end
|
42
46
|
private_class_method :create_xref_data
|
43
47
|
|
48
|
+
def self.create_name_xrefs(team)
|
49
|
+
name_xrefs = {}
|
50
|
+
team.data.each do |member|
|
51
|
+
name_xrefs[member.last['deprecated_name']] =
|
52
|
+
member.last['name'] if member.last['deprecated_name']
|
53
|
+
end
|
54
|
+
name_xrefs
|
55
|
+
end
|
56
|
+
|
44
57
|
def self.xref_tags_and_team_members(site, tag_categories, team_xref)
|
45
58
|
team = (site.data['team'] || {})
|
46
59
|
tag_categories.each do |category|
|
data/lib/team_api/joiner.rb
CHANGED
@@ -151,7 +151,8 @@ module TeamApi
|
|
151
151
|
|
152
152
|
def store_project_errors(project, errors)
|
153
153
|
project['errors'] = errors
|
154
|
-
name = project['github'][0]
|
154
|
+
name = project['github'][0] if project['github']
|
155
|
+
name ||= project['name']
|
155
156
|
data['errors'][name] = errors
|
156
157
|
end
|
157
158
|
|
data/lib/team_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: team_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Bland
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|