microsoft_kiota_faraday 0.12.0 → 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1fde07a89a8d7741101e0fb5704b734ea32ffcf67e640f4987c18c214e86a8b9
4
- data.tar.gz: 329c905f02acf463d9222976d0d1bd6e0bd992896a06b3f620f778e0c825cd65
3
+ metadata.gz: f578ca1ba0645ad59b24a6487c383b351eb016ec9d39c860ae4e04bdde229fdd
4
+ data.tar.gz: 791230af8f46ce2bb510ad00a973580f97073c4a9aa2f0a95943d4b97a492a7a
5
5
  SHA512:
6
- metadata.gz: bf99883e42ab84e66b5e8c1d219dbeb1c8ddd1568f993c577283640960cb9889e0c28e2a847429cd1b1190abaae415a7f9e149a7882c217fb892cfb64e6dd6a5
7
- data.tar.gz: 18aee467d6bdd9008b2e9b48c037c3d89a77d48918941747da729ffa740e280c67d2168b795c5f12bc4d0fb2db0386b5c888cc97551d6bc1527187176b1ac4db
6
+ metadata.gz: 17e3764eff9ceade43ab88d8011651803587ce3352ba8cf7538ed8b0636c59c2a9b7736ae731f13e4426be1553f33180ba50f5bca67053035c8d91b8aa2a65e0
7
+ data.tar.gz: 5e0adce35b9732ee8e45c0c5cf21109c0b9c48c1ba8bd58251fcd57d5627c168e7eecc7e376b39d20bcfdece9ba2836b9a2fbcc58fd6db148d56a6dfcfbd76e3
@@ -0,0 +1,101 @@
1
+ id:
2
+ name: GitOps.PullRequestIssueManagement
3
+ description: GitOps.PullRequestIssueManagement primitive
4
+ owner:
5
+ resource: repository
6
+ disabled: false
7
+ where:
8
+ configuration:
9
+ resourceManagementConfiguration:
10
+ scheduledSearches:
11
+ - description:
12
+ frequencies:
13
+ - hourly:
14
+ hour: 6
15
+ filters:
16
+ - isIssue
17
+ - isOpen
18
+ - hasLabel:
19
+ label: 'Needs: Author Feedback'
20
+ - hasLabel:
21
+ label: 'Status: No Recent Activity'
22
+ - noActivitySince:
23
+ days: 3
24
+ actions:
25
+ - closeIssue
26
+ - description:
27
+ frequencies:
28
+ - hourly:
29
+ hour: 6
30
+ filters:
31
+ - isIssue
32
+ - isOpen
33
+ - hasLabel:
34
+ label: 'Needs: Author Feedback'
35
+ - noActivitySince:
36
+ days: 4
37
+ - isNotLabeledWith:
38
+ label: 'Status: No Recent Activity'
39
+ actions:
40
+ - addLabel:
41
+ label: 'Status: No Recent Activity'
42
+ - addReply:
43
+ reply: This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
44
+ - description:
45
+ frequencies:
46
+ - hourly:
47
+ hour: 6
48
+ filters:
49
+ - isIssue
50
+ - isOpen
51
+ - hasLabel:
52
+ label: 'Resolution: Duplicate'
53
+ - noActivitySince:
54
+ days: 1
55
+ actions:
56
+ - addReply:
57
+ reply: This issue has been marked as duplicate and has not had any activity for **1 day**. It will be closed for housekeeping purposes.
58
+ - closeIssue
59
+ eventResponderTasks:
60
+ - if:
61
+ - payloadType: Issue_Comment
62
+ - isAction:
63
+ action: Created
64
+ - isActivitySender:
65
+ issueAuthor: True
66
+ - hasLabel:
67
+ label: 'Needs: Author Feedback'
68
+ - isOpen
69
+ then:
70
+ - addLabel:
71
+ label: 'Needs: Attention :wave:'
72
+ - removeLabel:
73
+ label: 'Needs: Author Feedback'
74
+ description:
75
+ - if:
76
+ - payloadType: Issues
77
+ - not:
78
+ isAction:
79
+ action: Closed
80
+ - hasLabel:
81
+ label: 'Status: No Recent Activity'
82
+ then:
83
+ - removeLabel:
84
+ label: 'Status: No Recent Activity'
85
+ description:
86
+ - if:
87
+ - payloadType: Issue_Comment
88
+ - hasLabel:
89
+ label: 'Status: No Recent Activity'
90
+ then:
91
+ - removeLabel:
92
+ label: 'Status: No Recent Activity'
93
+ description:
94
+ - if:
95
+ - payloadType: Pull_Request
96
+ then:
97
+ - inPrLabel:
98
+ label: WIP
99
+ description:
100
+ onFailure:
101
+ onSuccess:
@@ -19,7 +19,7 @@ jobs:
19
19
  steps:
20
20
  - name: Dependabot metadata
21
21
  id: metadata
22
- uses: dependabot/fetch-metadata@v1.3.6
22
+ uses: dependabot/fetch-metadata@v1.6.0
23
23
  with:
24
24
  github-token: "${{ secrets.GITHUB_TOKEN }}"
25
25
 
@@ -40,11 +40,11 @@ jobs:
40
40
 
41
41
  steps:
42
42
  - name: Checkout repository
43
- uses: actions/checkout@v3
43
+ uses: actions/checkout@v4
44
44
 
45
45
  # Initializes the CodeQL tools for scanning.
46
46
  - name: Initialize CodeQL
47
- uses: github/codeql-action/init@v2
47
+ uses: github/codeql-action/init@v3
48
48
  with:
49
49
  languages: ${{ matrix.language }}
50
50
  # If you wish to specify custom queries, you can do so here or in a config file.
@@ -58,7 +58,7 @@ jobs:
58
58
  # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
59
59
  # If this step fails, then you should remove it and run the build manually (see below)
60
60
  - name: Autobuild
61
- uses: github/codeql-action/autobuild@v2
61
+ uses: github/codeql-action/autobuild@v3
62
62
 
63
63
  # ℹ️ Command-line programs to run using the OS shell.
64
64
  # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -71,6 +71,6 @@ jobs:
71
71
  # ./location_of_script_within_repo/buildscript.sh
72
72
 
73
73
  - name: Perform CodeQL Analysis
74
- uses: github/codeql-action/analyze@v2
74
+ uses: github/codeql-action/analyze@v3
75
75
  with:
76
76
  category: "/language:${{matrix.language}}"
@@ -11,6 +11,10 @@ on:
11
11
  types: [synchronize]
12
12
  branches: [ main ]
13
13
 
14
+ permissions:
15
+ pull-requests: write
16
+ contents: read
17
+
14
18
  # A workflow run is made up of one or more jobs that can run sequentially or in parallel
15
19
  jobs:
16
20
  # This workflow contains a single job called "build"
@@ -6,13 +6,16 @@ on:
6
6
  - "v[0-9]+.[0-9]+.[0-9]+"
7
7
  workflow_dispatch:
8
8
 
9
+ permissions:
10
+ contents: write
11
+
9
12
  jobs:
10
13
  Git_Release:
11
14
  runs-on: ubuntu-latest
12
15
  steps:
13
- - uses: actions/checkout@v3
16
+ - uses: actions/checkout@v4
14
17
  - name: Github Release
15
- uses: anton-yurchenko/git-release@v5.0
18
+ uses: anton-yurchenko/git-release@v6.0
16
19
  env:
17
20
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}}
18
21
  DRAFT_RELEASE: "false"
@@ -25,7 +28,7 @@ jobs:
25
28
  name: production_feeds
26
29
  runs-on: ubuntu-latest
27
30
  steps:
28
- - uses: actions/checkout@v3
31
+ - uses: actions/checkout@v4
29
32
  - uses: ruby/setup-ruby@v1
30
33
  with:
31
34
  ruby-version: '3.2'
@@ -15,7 +15,7 @@ jobs:
15
15
  ruby-version: ['3.0', '3.1', '3.2', head, jruby, jruby-head, truffleruby, truffleruby-head]
16
16
  runs-on: ${{ matrix.os }}
17
17
  steps:
18
- - uses: actions/checkout@v3
18
+ - uses: actions/checkout@v4
19
19
  - uses: ruby/setup-ruby@v1
20
20
  with:
21
21
  ruby-version: ${{ matrix.ruby-version }}
@@ -26,7 +26,7 @@ jobs:
26
26
  run: bundle exec rake
27
27
  - name: Upload artifacts for ruby version 3 and ubuntu
28
28
  if: ${{ matrix.os == 'ubuntu-latest' && matrix.ruby-version == '3.2'}}
29
- uses: actions/upload-artifact@v3
29
+ uses: actions/upload-artifact@v4
30
30
  with:
31
31
  name: drop
32
32
  path: |
data/CHANGELOG.md CHANGED
@@ -11,6 +11,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
11
11
 
12
12
  ### Changed
13
13
 
14
+ ## [0.14.0] - 2024-02-14
15
+
16
+ ### Changed
17
+
18
+ - Make sure the base_url is set when calling authenticate_request. [#27](https://github.com/microsoft/kiota-http-ruby/pull/27)
19
+
20
+ ## [0.13.0] - 2024-02-05
21
+
22
+ ### Changed
23
+
24
+ - Added support for error mapping deduplication to reduce generated code. [#20](https://github.com/microsoft/kiota-http-ruby/issues/20)
25
+
14
26
  ## [0.12.0] - 2023-03-28
15
27
 
16
28
  ### Changed
@@ -9,7 +9,7 @@ module MicrosoftKiotaFaraday
9
9
  include MicrosoftKiotaAbstractions::RequestAdapter
10
10
 
11
11
  attr_accessor :authentication_provider, :content_type_header_key, :parse_node_factory, :serialization_writer_factory, :client
12
-
12
+
13
13
  def initialize(authentication_provider, parse_node_factory=MicrosoftKiotaAbstractions::ParseNodeFactoryRegistry.default_instance, serialization_writer_factory=MicrosoftKiotaAbstractions::SerializationWriterFactoryRegistry.default_instance, client = KiotaClientFactory::get_default_http_client)
14
14
 
15
15
  if !authentication_provider
@@ -21,7 +21,7 @@ module MicrosoftKiotaFaraday
21
21
  if @parse_node_factory.nil?
22
22
  @parse_node_factory = MicrosoftKiotaAbstractions::ParseNodeFactoryRegistry.default_instance
23
23
  end
24
- @serialization_writer_factory = serialization_writer_factory
24
+ @serialization_writer_factory = serialization_writer_factory
25
25
  if @serialization_writer_factory.nil?
26
26
  @serialization_writer_factory = MicrosoftKiotaAbstractions::SerializationWriterFactoryRegistry.default_instance
27
27
  end
@@ -49,6 +49,7 @@ module MicrosoftKiotaFaraday
49
49
  raise StandardError, 'factory cannot be null' unless factory
50
50
 
51
51
  Fiber.new do
52
+ set_base_url_for_request_information(request_info)
52
53
  @authentication_provider.authenticate_request(request_info).resume
53
54
  request = self.get_request_from_request_info(request_info)
54
55
  response = @client.run_request(request.http_method, request.path, request.body, request.headers)
@@ -83,6 +84,7 @@ module MicrosoftKiotaFaraday
83
84
  error_factory = errors_mapping[status_code] unless errors_mapping.nil?
84
85
  error_factory = errors_mapping['4XX'] unless !error_factory.nil? || errors_mapping.nil? || status_code > 500
85
86
  error_factory = errors_mapping['5XX'] unless !error_factory.nil? || errors_mapping.nil? || status_code < 500 || status_code > 600
87
+ error_factory = errors_mapping['XXX'] unless !error_factory.nil? || errors_mapping.nil? || status_code < 400 || status_code > 600
86
88
  raise MicrosoftKiotaAbstractions::ApiError, 'The server returned an unexpected status code and no error factory is registered for this code:' + status_code.to_s if error_factory.nil?
87
89
  root_node = self.get_root_parse_node(response)
88
90
  error = root_node.get_object_value(error_factory) unless root_node.nil?
@@ -91,7 +93,7 @@ module MicrosoftKiotaFaraday
91
93
  end
92
94
 
93
95
  def get_request_from_request_info(request_info)
94
- request_info.path_parameters['baseurl'] = @base_url
96
+ set_base_url_for_request_information(request_info)
95
97
  case request_info.http_method
96
98
  when :GET
97
99
  request = @client.build_request(:get)
@@ -117,7 +119,7 @@ module MicrosoftKiotaFaraday
117
119
  request.path = request_info.uri
118
120
  unless request_info.headers.nil? then
119
121
  request.headers = Faraday::Utils::Headers.new
120
- request_info.headers.get_all.select{|k,v|
122
+ request_info.headers.get_all.select{|k,v|
121
123
  if v.kind_of? Array then
122
124
  request.headers[k] = v.join(',')
123
125
  elsif v.kind_of? String then
@@ -150,10 +152,16 @@ module MicrosoftKiotaFaraday
150
152
  def convert_to_native_request_async(request_info)
151
153
  raise StandardError, 'request_info cannot be null' unless request_info
152
154
  return Fiber.new do
155
+ set_base_url_for_request_information(request_info)
153
156
  @authentication_provider.authenticate_request(request_info).resume
154
157
  return self.get_request_from_request_info(request_info)
155
158
  end
156
159
  end
157
160
 
161
+ private
162
+
163
+ def set_base_url_for_request_information(request_info)
164
+ request_info.path_parameters['baseurl'] = @base_url
165
+ end
158
166
  end
159
167
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MicrosoftKiotaFaraday
4
- VERSION = '0.12.0'
4
+ VERSION = '0.14.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: microsoft_kiota_faraday
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Microsoft Corporation
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-28 00:00:00.000000000 Z
11
+ date: 2024-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: microsoft_kiota_abstractions
@@ -94,10 +94,10 @@ extra_rdoc_files: []
94
94
  files:
95
95
  - ".github/CODEOWNERS"
96
96
  - ".github/dependabot.yml"
97
+ - ".github/policies/resourceManagement.yml"
97
98
  - ".github/workflows/auto-merge-dependabot.yml"
98
99
  - ".github/workflows/code-ql.yml"
99
100
  - ".github/workflows/conflicting-pr-label.yml"
100
- - ".github/workflows/projectsbot.yml"
101
101
  - ".github/workflows/release.yml"
102
102
  - ".github/workflows/ruby.yml"
103
103
  - ".gitignore"
@@ -144,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
144
  - !ruby/object:Gem::Version
145
145
  version: '0'
146
146
  requirements: []
147
- rubygems_version: 3.4.6
147
+ rubygems_version: 3.4.19
148
148
  signing_key:
149
149
  specification_version: 4
150
150
  summary: Microsoft Kiota Faraday - Kiota Ruby http request adapter for running requests
@@ -1,81 +0,0 @@
1
- # This workflow is used to add new issues to GitHub Projects (Beta)
2
-
3
- name: Add PR to project
4
- on:
5
- issues:
6
- types: [opened]
7
- jobs:
8
- track_issue:
9
- runs-on: ubuntu-latest
10
- steps:
11
- - name: Generate token
12
- id: generate_token
13
- uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92
14
- with:
15
- app_id: ${{ secrets.GRAPHBOT_APP_ID }}
16
- private_key: ${{ secrets.GRAPHBOT_APP_PEM }}
17
-
18
- - name: Get project data
19
- env:
20
- GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
21
- ORGANIZATION: microsoftgraph
22
- PROJECT_NUMBER: 38
23
- run: |
24
- gh api graphql -f query='
25
- query($org: String!, $number: Int!) {
26
- organization(login: $org){
27
- projectNext(number: $number) {
28
- id
29
- fields(first:20) {
30
- nodes {
31
- id
32
- name
33
- settings
34
- }
35
- }
36
- }
37
- }
38
- }' -f org=$ORGANIZATION -F number=$PROJECT_NUMBER > project_data.json
39
-
40
- echo 'PROJECT_ID='$(jq '.data.organization.projectNext.id' project_data.json) >> $GITHUB_ENV
41
- echo 'STATUS_FIELD_ID='$(jq '.data.organization.projectNext.fields.nodes[] | select(.name== "Status") | .id' project_data.json) >> $GITHUB_ENV
42
- echo 'TRIAGE_OPTION_ID='$(jq '.data.organization.projectNext.fields.nodes[] | select(.name== "Status") |.settings | fromjson.options[] | select(.name=="Needs Triage 🔍") |.id' project_data.json) >> $GITHUB_ENV
43
-
44
- - name: Add Issue to project
45
- env:
46
- GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
47
- ISSUE_ID: ${{ github.event.issue.node_id }}
48
- run: |
49
- item_id="$( gh api graphql -f query='
50
- mutation($project:ID!, $issue:ID!) {
51
- addProjectNextItem(input: {projectId: $project, contentId: $issue}) {
52
- projectNextItem {
53
- id
54
- }
55
- }
56
- }' -f project=$PROJECT_ID -f issue=$ISSUE_ID --jq '.data.addProjectNextItem.projectNextItem.id')"
57
-
58
- echo 'ITEM_ID='$item_id >> $GITHUB_ENV
59
-
60
- - name: Set Triage
61
- env:
62
- GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
63
- run: |
64
- gh api graphql -f query='
65
- mutation (
66
- $project: ID!
67
- $item: ID!
68
- $status_field: ID!
69
- $status_value: String!
70
- ) {
71
- set_status: updateProjectNextItemField(input: {
72
- projectId: $project
73
- itemId: $item
74
- fieldId: $status_field
75
- value: $status_value
76
- }) {
77
- projectNextItem {
78
- id
79
- }
80
- }
81
- }' -f project=$PROJECT_ID -f item=$ITEM_ID -f status_field=$STATUS_FIELD_ID -f status_value=${{ env.TRIAGE_OPTION_ID }} --silent