Skip to content

Commit 08a2075

Browse files
authored
Fix role schema (#27)
* fix(breaking): be consistent where permissions get marked in orgs, repos and teams * chore: lint & poetry * chore: bump version
1 parent f3c3f8c commit 08a2075

File tree

14 files changed

+569
-570
lines changed

14 files changed

+569
-570
lines changed

nodestream_github/github_organizations.yaml

Lines changed: 74 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -6,83 +6,81 @@
66
- implementation: nodestream.interpreting:Interpreter
77
arguments:
88
interpretations:
9-
- type: source_node
10-
node_type: GithubOrg
11-
key_normalization:
12-
do_lowercase_strings: false
13-
key:
14-
node_id: !jmespath 'node_id'
15-
additional_indexes:
16-
- name
17-
- login
18-
- html_url
19-
- type: properties
20-
properties:
21-
login: !jmespath 'login'
22-
id: !jmespath 'id'
23-
url: !jmespath 'url'
24-
description: !jmespath 'description'
25-
name: !jmespath 'name'
26-
company: !jmespath 'company'
27-
blog: !jmespath 'blog'
28-
location: !jmespath 'location'
29-
email: !jmespath 'email'
30-
twitter_username: !jmespath 'twitter_username'
31-
is_verified: !jmespath 'is_verified'
32-
has_organization_projects: !jmespath 'has_organization_projects'
33-
has_repository_projects: !jmespath 'has_repository_projects'
34-
public_repos: !jmespath 'public_repos'
35-
public_gists: !jmespath 'public_gists'
36-
followers: !jmespath 'followers'
37-
following: !jmespath 'following'
38-
html_url: !jmespath 'html_url'
39-
created_at: !jmespath 'created_at'
40-
type: !jmespath 'type'
41-
total_private_repos: !jmespath 'total_private_repos'
42-
owned_private_repos: !jmespath 'owned_private_repos'
43-
private_gists: !jmespath 'private_gists'
44-
disk_usage: !jmespath 'disk_usage'
45-
collaborators: !jmespath 'collaborators'
46-
billing_email: !jmespath 'billing_email'
47-
plan: !jmespath 'plan.name'
48-
default_repository_permission: !jmespath 'default_repository_permission'
49-
members_can_create_repositories: !jmespath 'members_can_create_repositories'
50-
two_factor_requirement_enabled: !jmespath 'two_factor_requirement_enabled'
51-
members_allowed_repository_creation_type: !jmespath 'members_allowed_repository_creation_type'
52-
members_can_create_public_repositories: !jmespath 'members_can_create_public_repositories'
53-
members_can_create_private_repositories: !jmespath 'members_can_create_private_repositories'
54-
members_can_create_internal_repositories: !jmespath 'members_can_create_internal_repositories'
55-
members_can_create_pages: !jmespath 'members_can_create_pages'
56-
members_can_create_public_pages: !jmespath 'members_can_create_public_pages'
57-
members_can_create_private_pages: !jmespath 'members_can_create_private_pages'
58-
members_can_fork_private_repositories: !jmespath 'members_can_fork_private_repositories'
59-
web_commit_signoff_required: !jmespath 'web_commit_signoff_required'
60-
updated_at: !jmespath 'updated_at'
61-
dependency_graph_enabled_for_new_repositories: !jmespath 'dependency_graph_enabled_for_new_repositories'
62-
dependabot_alerts_enabled_for_new_repositories: !jmespath 'dependabot_alerts_enabled_for_new_repositories'
63-
dependabot_security_updates_enabled_for_new_repositories: !jmespath 'dependabot_security_updates_enabled_for_new_repositories'
64-
advanced_security_enabled_for_new_repositories: !jmespath 'advanced_security_enabled_for_new_repositories'
65-
secret_scanning_enabled_for_new_repositories: !jmespath 'secret_scanning_enabled_for_new_repositories'
66-
secret_scanning_push_protection_enabled_for_new_repositories: !jmespath 'secret_scanning_push_protection_enabled_for_new_repositories'
67-
secret_scanning_push_protection_custom_link: !jmespath 'secret_scanning_push_protection_custom_link'
68-
secret_scanning_push_protection_custom_link_enabled: !jmespath 'secret_scanning_push_protection_custom_link_enabled'
9+
- type: source_node
10+
node_type: GithubOrg
11+
key_normalization:
12+
do_lowercase_strings: false
13+
key:
14+
node_id: !jmespath 'node_id'
15+
additional_indexes:
16+
- name
17+
- login
18+
- html_url
19+
- type: properties
20+
properties:
21+
login: !jmespath 'login'
22+
id: !jmespath 'id'
23+
url: !jmespath 'url'
24+
description: !jmespath 'description'
25+
name: !jmespath 'name'
26+
company: !jmespath 'company'
27+
blog: !jmespath 'blog'
28+
location: !jmespath 'location'
29+
email: !jmespath 'email'
30+
twitter_username: !jmespath 'twitter_username'
31+
is_verified: !jmespath 'is_verified'
32+
has_organization_projects: !jmespath 'has_organization_projects'
33+
has_repository_projects: !jmespath 'has_repository_projects'
34+
public_repos: !jmespath 'public_repos'
35+
public_gists: !jmespath 'public_gists'
36+
followers: !jmespath 'followers'
37+
following: !jmespath 'following'
38+
html_url: !jmespath 'html_url'
39+
created_at: !jmespath 'created_at'
40+
type: !jmespath 'type'
41+
total_private_repos: !jmespath 'total_private_repos'
42+
owned_private_repos: !jmespath 'owned_private_repos'
43+
private_gists: !jmespath 'private_gists'
44+
disk_usage: !jmespath 'disk_usage'
45+
collaborators: !jmespath 'collaborators'
46+
billing_email: !jmespath 'billing_email'
47+
plan: !jmespath 'plan.name'
48+
default_repository_permission: !jmespath 'default_repository_permission'
49+
members_can_create_repositories: !jmespath 'members_can_create_repositories'
50+
two_factor_requirement_enabled: !jmespath 'two_factor_requirement_enabled'
51+
members_allowed_repository_creation_type: !jmespath 'members_allowed_repository_creation_type'
52+
members_can_create_public_repositories: !jmespath 'members_can_create_public_repositories'
53+
members_can_create_private_repositories: !jmespath 'members_can_create_private_repositories'
54+
members_can_create_internal_repositories: !jmespath 'members_can_create_internal_repositories'
55+
members_can_create_pages: !jmespath 'members_can_create_pages'
56+
members_can_create_public_pages: !jmespath 'members_can_create_public_pages'
57+
members_can_create_private_pages: !jmespath 'members_can_create_private_pages'
58+
members_can_fork_private_repositories: !jmespath 'members_can_fork_private_repositories'
59+
web_commit_signoff_required: !jmespath 'web_commit_signoff_required'
60+
updated_at: !jmespath 'updated_at'
61+
dependency_graph_enabled_for_new_repositories: !jmespath 'dependency_graph_enabled_for_new_repositories'
62+
dependabot_alerts_enabled_for_new_repositories: !jmespath 'dependabot_alerts_enabled_for_new_repositories'
63+
dependabot_security_updates_enabled_for_new_repositories: !jmespath 'dependabot_security_updates_enabled_for_new_repositories'
64+
advanced_security_enabled_for_new_repositories: !jmespath 'advanced_security_enabled_for_new_repositories'
65+
secret_scanning_enabled_for_new_repositories: !jmespath 'secret_scanning_enabled_for_new_repositories'
66+
secret_scanning_push_protection_enabled_for_new_repositories: !jmespath 'secret_scanning_push_protection_enabled_for_new_repositories'
67+
secret_scanning_push_protection_custom_link: !jmespath 'secret_scanning_push_protection_custom_link'
68+
secret_scanning_push_protection_custom_link_enabled: !jmespath 'secret_scanning_push_protection_custom_link_enabled'
6969

70-
- type: github-user-relationship
71-
relationship_type: IS_MEMBER
72-
iterate_on: !jmespath 'members[*]'
73-
outbound: false
74-
key_normalization:
75-
do_lowercase_strings: false
76-
relationship_properties:
77-
role: !jmespath 'role'
70+
- type: github-user-relationship
71+
relationship_type: IS_MEMBER
72+
iterate_on: !jmespath 'members[*]'
73+
outbound: false
74+
key_normalization:
75+
do_lowercase_strings: false
76+
relationship_properties:
77+
role: !jmespath 'role'
7878

79-
- type: github-repo-relationship
80-
relationship_type: IN_ORGANIZATION
81-
iterate_on: !jmespath 'repositories[*]'
82-
outbound: false
83-
key_normalization:
84-
do_lowercase_strings: false
85-
relationship_properties:
86-
permission: !jmespath 'permission'
79+
- type: github-repo-relationship
80+
relationship_type: IN_ORGANIZATION
81+
iterate_on: !jmespath 'repositories[*]'
82+
outbound: false
83+
key_normalization:
84+
do_lowercase_strings: false
8785

8886

nodestream_github/github_repos.yaml

Lines changed: 110 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -7,120 +7,120 @@
77
- implementation: nodestream.interpreting:Interpreter
88
arguments:
99
interpretations:
10-
- type: source_node
11-
node_type: GithubRepo
12-
additional_indexes:
13-
- full_name
14-
- html_url
15-
key_normalization:
16-
do_lowercase_strings: false
17-
key:
18-
node_id: !jmespath 'node_id'
19-
- type: properties
20-
properties:
21-
id: !jmespath 'id'
22-
name: !jmespath 'name'
23-
full_name: !jmespath 'full_name'
24-
private: !jmespath 'private'
25-
html_url: !jmespath 'html_url'
26-
description: !jmespath 'description'
27-
fork: !jmespath 'fork'
28-
url: !jmespath 'url'
29-
homepage: !jmespath 'homepage'
30-
language: !jmespath 'language'
31-
forks_count: !jmespath 'forks_count'
32-
stargazers_count: !jmespath 'stargazers_count'
33-
watchers_count: !jmespath 'watchers_count'
34-
size: !jmespath 'size'
35-
default_branch: !jmespath 'default_branch'
36-
open_issues_count: !jmespath 'open_issues_count'
37-
is_template: !jmespath 'is_template'
38-
topics: !jmespath 'topics'
39-
has_issues: !jmespath 'has_issues'
40-
has_projects: !jmespath 'has_projects'
41-
has_wiki: !jmespath 'has_wiki'
42-
has_pages: !jmespath 'has_pages'
43-
has_downloads: !jmespath 'has_downloads'
44-
has_discussions: !jmespath 'has_discussions'
45-
archived: !jmespath 'archived'
46-
disabled: !jmespath 'disabled'
47-
visibility: !jmespath 'visibility'
48-
pushed_at: !jmespath 'pushed_at'
49-
created_at: !jmespath 'created_at'
50-
updated_at: !jmespath 'updated_at'
51-
security_and_analysis_advanced_security: !jmespath 'security_and_analysis.advanced_security.status'
52-
security_and_analysis_secret_scanning: !jmespath 'security_and_analysis.secret_scanning.status'
53-
security_and_analysis_secret_scanning_push_protection: !jmespath 'security_and_analysis.secret_scanning_push_protection.status'
10+
- type: source_node
11+
node_type: GithubRepo
12+
additional_indexes:
13+
- full_name
14+
- html_url
15+
key_normalization:
16+
do_lowercase_strings: false
17+
key:
18+
node_id: !jmespath 'node_id'
19+
- type: properties
20+
properties:
21+
id: !jmespath 'id'
22+
name: !jmespath 'name'
23+
full_name: !jmespath 'full_name'
24+
private: !jmespath 'private'
25+
html_url: !jmespath 'html_url'
26+
description: !jmespath 'description'
27+
fork: !jmespath 'fork'
28+
url: !jmespath 'url'
29+
homepage: !jmespath 'homepage'
30+
language: !jmespath 'language'
31+
forks_count: !jmespath 'forks_count'
32+
stargazers_count: !jmespath 'stargazers_count'
33+
watchers_count: !jmespath 'watchers_count'
34+
size: !jmespath 'size'
35+
default_branch: !jmespath 'default_branch'
36+
open_issues_count: !jmespath 'open_issues_count'
37+
is_template: !jmespath 'is_template'
38+
topics: !jmespath 'topics'
39+
has_issues: !jmespath 'has_issues'
40+
has_projects: !jmespath 'has_projects'
41+
has_wiki: !jmespath 'has_wiki'
42+
has_pages: !jmespath 'has_pages'
43+
has_downloads: !jmespath 'has_downloads'
44+
has_discussions: !jmespath 'has_discussions'
45+
archived: !jmespath 'archived'
46+
disabled: !jmespath 'disabled'
47+
visibility: !jmespath 'visibility'
48+
pushed_at: !jmespath 'pushed_at'
49+
created_at: !jmespath 'created_at'
50+
updated_at: !jmespath 'updated_at'
51+
security_and_analysis_advanced_security: !jmespath 'security_and_analysis.advanced_security.status'
52+
security_and_analysis_secret_scanning: !jmespath 'security_and_analysis.secret_scanning.status'
53+
security_and_analysis_secret_scanning_push_protection: !jmespath 'security_and_analysis.secret_scanning_push_protection.status'
5454

55-
- type: relationship
56-
node_type: GithubOrg
57-
relationship_type: IN_ORGANIZATION
58-
key_normalization:
59-
do_lowercase_strings: false
60-
node_key:
61-
node_id: !jmespath 'org_owner.node_id'
62-
node_properties:
63-
id: !jmespath "org_owner.id"
64-
name: !jmespath "org_owner.name"
65-
login: !jmespath "org_owner.login"
55+
- type: relationship
56+
node_type: GithubOrg
57+
relationship_type: IN_ORGANIZATION
58+
key_normalization:
59+
do_lowercase_strings: false
60+
node_key:
61+
node_id: !jmespath 'org_owner.node_id'
62+
node_properties:
63+
id: !jmespath "org_owner.id"
64+
name: !jmespath "org_owner.name"
65+
login: !jmespath "org_owner.login"
6666

6767

68-
- type: relationship
69-
node_type: GithubUser
70-
relationship_type: IS_OWNER
71-
outbound: false
72-
key_normalization:
73-
do_lowercase_strings: false
74-
node_key:
75-
node_id: !jmespath 'user_owner.node_id'
76-
node_properties:
77-
id: !jmespath "user_owner.id"
78-
login: !jmespath "user_owner.login"
68+
- type: relationship
69+
node_type: GithubUser
70+
relationship_type: IS_OWNER
71+
outbound: false
72+
key_normalization:
73+
do_lowercase_strings: false
74+
node_key:
75+
node_id: !jmespath 'user_owner.node_id'
76+
node_properties:
77+
id: !jmespath "user_owner.id"
78+
login: !jmespath "user_owner.login"
7979

80-
- type: github-user-relationship
81-
relationship_type: IS_COLLABORATOR
82-
iterate_on: !jmespath 'collaborators[*]'
83-
outbound: false
84-
key_normalization:
85-
do_lowercase_strings: false
86-
relationship_properties:
87-
"affiliation": !jmespath "affiliation"
88-
"permission": !jmespath "role_name"
80+
- type: github-user-relationship
81+
relationship_type: IS_COLLABORATOR
82+
iterate_on: !jmespath 'collaborators[*]'
83+
outbound: false
84+
key_normalization:
85+
do_lowercase_strings: false
86+
relationship_properties:
87+
"affiliation": !jmespath "affiliation"
88+
"role_name": !jmespath "role_name"
8989

90-
- type: relationship
91-
node_type: ProgrammingLanguage
92-
relationship_type: HAS_LANGUAGE
93-
key_normalization:
94-
do_lowercase_strings: true
95-
node_key:
96-
name: !jmespath 'name'
97-
relationship_properties:
98-
size: !jmespath size
99-
iterate_on: !jmespath 'languages'
90+
- type: relationship
91+
node_type: ProgrammingLanguage
92+
relationship_type: HAS_LANGUAGE
93+
key_normalization:
94+
do_lowercase_strings: true
95+
node_key:
96+
name: !jmespath 'name'
97+
relationship_properties:
98+
size: !jmespath size
99+
iterate_on: !jmespath 'languages'
100100

101-
- type: relationship
102-
node_type: GithubWebhook
103-
iterate_on: !jmespath 'webhooks[*]'
104-
relationship_type: WEBHOOK_ON
105-
outbound: false
106-
key_normalization:
107-
do_lowercase_strings: false
108-
relationship_properties:
109-
events: !jmespath "events"
110-
node_key:
111-
id: !jmespath 'id'
112-
node_properties:
113-
type: !jmespath 'type'
114-
id: !jmespath 'id'
115-
name: !jmespath 'name'
116-
active: !jmespath 'active'
117-
config_content_type: !jmespath 'config.content_type'
118-
config_insecure_ssl: !jmespath 'config.insecure_ssl'
119-
config_url: !jmespath 'config.url'
120-
updated_at: !jmespath 'updated_at'
121-
created_at: !jmespath 'created_at'
122-
url: !jmespath 'url'
123-
last_response_code: !jmespath 'last_response.code'
124-
last_response_status: !jmespath 'last_response.status'
125-
last_response_message: !jmespath 'last_response.message'
101+
- type: relationship
102+
node_type: GithubWebhook
103+
iterate_on: !jmespath 'webhooks[*]'
104+
relationship_type: WEBHOOK_ON
105+
outbound: false
106+
key_normalization:
107+
do_lowercase_strings: false
108+
relationship_properties:
109+
events: !jmespath "events"
110+
node_key:
111+
id: !jmespath 'id'
112+
node_properties:
113+
type: !jmespath 'type'
114+
id: !jmespath 'id'
115+
name: !jmespath 'name'
116+
active: !jmespath 'active'
117+
config_content_type: !jmespath 'config.content_type'
118+
config_insecure_ssl: !jmespath 'config.insecure_ssl'
119+
config_url: !jmespath 'config.url'
120+
updated_at: !jmespath 'updated_at'
121+
created_at: !jmespath 'created_at'
122+
url: !jmespath 'url'
123+
last_response_code: !jmespath 'last_response.code'
124+
last_response_status: !jmespath 'last_response.status'
125+
last_response_message: !jmespath 'last_response.message'
126126

0 commit comments

Comments
 (0)