Skip to content

Commit 8e6d24d

Browse files
committed
Merge branch 'dev' into bugfix/295
2 parents 3a3dde2 + 16cfeb7 commit 8e6d24d

File tree

330 files changed

+19449
-1682
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

330 files changed

+19449
-1682
lines changed
Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# Licensed under the MIT License.
3+
4+
name: $(BuildDefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)
5+
6+
trigger: none # disable triggers based on commits.
7+
pr: none # disable triggers based on pull requests.
8+
9+
resources:
10+
repositories:
11+
- repository: msgraph-sdk-java # The name used to reference this repository in the checkout step
12+
type: github
13+
endpoint: microsoftgraph
14+
name: microsoftgraph/msgraph-sdk-java
15+
ref: dev # checkout the dev branch
16+
- repository: msgraph-metadata
17+
type: github
18+
endpoint: microsoftgraph
19+
name: microsoftgraph/msgraph-metadata
20+
ref: master #
21+
pipelines:
22+
- pipeline: publishMetadata # This pipeline validates and produces an metadata artifact that we use for generation.
23+
source: (v1.0 - 3) msgraph-publish-cleanmetadata
24+
trigger:
25+
branches:
26+
- master
27+
28+
pool:
29+
vmImage: windows-latest # Info about this image: [0][1]
30+
31+
variables:
32+
- group: MicrosoftGraph # Variable group, where variables not set here come from. Set in Azure DevOps
33+
34+
steps:
35+
- checkout: msgraph-sdk-java
36+
clean: true
37+
fetchDepth: 1
38+
persistCredentials: true
39+
- checkout: msgraph-metadata
40+
clean: true
41+
fetchDepth: 1
42+
43+
- task: PowerShell@2 # Setup environment variables and make them available to all tasks. See [1] for more info.
44+
displayName: 'Calculate and set pipeline variables for this job'
45+
inputs:
46+
targetType: inline
47+
script: |
48+
49+
$repoModelsDir = "$env:Build_SourcesDirectory\msgraph-sdk-java\src\main\java\com\microsoft\graph\models\generated\"
50+
$repoModelsExtensionDir = "$env:Build_SourcesDirectory\msgraph-sdk-java\src\main\java\com\microsoft\graph\models\extensions\"
51+
$repoRequestExtensionDir = "$env:Build_SourcesDirectory\msgraph-sdk-java\src\main\java\com\microsoft\graph\requests\extensions\"
52+
Write-Host "Path to repo model directory: $repoModelsDir"
53+
Write-Host "Path to repo model extension directory: $repoModelsExtensionDir"
54+
Write-Host "Path to repo request directory: $repoRequestExtensionDir"
55+
Write-Host "##vso[task.setvariable variable=repoModelsDir]$repoModelsDir"
56+
Write-Host "##vso[task.setvariable variable=repoModelsExtensionDir]$repoModelsExtensionDir"
57+
Write-Host "##vso[task.setvariable variable=repoRequestExtensionDir]$repoRequestExtensionDir"
58+
59+
$outputPath = Join-Path $env:Build_SourcesDirectory "output"
60+
Write-Host "Path to typewriter.exe output $outputPath"
61+
Write-Host "##vso[task.setvariable variable=outputPath]$outputPath"
62+
63+
$cleanMetadata = "https://raw.githubusercontent.com/microsoftgraph/msgraph-metadata/master/clean_v10_metadata/cleanMetadataWithDescriptionsv1.0.xml"
64+
Write-Host "Path to clean metadata $cleanMetadata"
65+
Write-Host "##vso[task.setvariable variable=cleanMetadata]$cleanMetadata"
66+
67+
$branchName = "v1.0/pipelinebuild/$env:Build_BuildId" # Match the spec in the GH Action
68+
Write-Host "Branch path spec for the pull request will be $branchName"
69+
Write-Host "##vso[task.setvariable variable=branchName]$branchName"
70+
71+
- task: PowerShell@2
72+
displayName: 'Git: checkout dev'
73+
inputs:
74+
targetType: inline
75+
workingDirectory: '$(Build.SourcesDirectory)/msgraph-sdk-java'
76+
script: |
77+
git checkout dev | Write-Host
78+
79+
- task: PowerShell@2
80+
displayName: 'Git: branch from dev named with the build id: $(Build.BuildId)'
81+
inputs:
82+
targetType: inline
83+
workingDirectory: '$(Build.SourcesDirectory)/msgraph-sdk-java'
84+
script: |
85+
86+
Write-Host "The new branch name will be: $env:branchName"
87+
git checkout -B $env:branchName | Write-Host
88+
89+
- task: PowerShell@2
90+
displayName: 'Git: set user config'
91+
inputs:
92+
targetType: inline
93+
workingDirectory: '$(Build.SourcesDirectory)/msgraph-sdk-java'
94+
script: |
95+
git config user.email "[email protected]"
96+
git config user.name "Microsoft Graph DevX Tooling"
97+
98+
- task: PowerShell@2
99+
displayName: 'Remove generated models and requests from the repo'
100+
inputs:
101+
targetType: inline
102+
script: |
103+
Remove-Item -Recurse $env:repoModelsDir | Write-Host
104+
Remove-Item -Recurse $env:repoModelsExtensionDir | Write-Host
105+
Remove-Item -Recurse $env:repoRequestExtensionDir | Write-Host
106+
Write-Host "Removed the existing generated files in the repo." -ForegroundColor Green
107+
enabled: false # The old GUI pipeline wasn't doing this. I recall that there was a reason
108+
# for this but I can't recall the reason but I think it was related to reducing number of
109+
# generated files.
110+
111+
- task: PowerShell@2
112+
displayName: 'Typewriter: generate v1.0 Java files'
113+
inputs:
114+
targetType: filePath
115+
filePath: '$(Build.SourcesDirectory)/msgraph-metadata/scripts/runTypewriter.ps1'
116+
arguments: '-verbosity Info -language Java -metadata $(cleanMetadata) -output $(outputPath) -generationMode Files'
117+
workingDirectory: '$(Build.SourcesDirectory)' # Set the root for a multi-repo pipeline. /s
118+
enabled: true
119+
120+
- task: PowerShell@2
121+
displayName: 'Copy generated requests and models into the repo'
122+
inputs:
123+
targetType: inline
124+
script: |
125+
# Path to typewriter output
126+
$modelsDirectory = Join-Path $env:outputPath "\com\microsoft\graph\models\generated\*"
127+
$modelsExtensionsDirectory = Join-Path $env:outputPath "\com\microsoft\graph\models\extensions\*"
128+
$requestsExtensionsDirectory = Join-Path $env:outputPath "\com\microsoft\graph\requests\extensions\*"
129+
130+
# models\generated - excluding Base* should not be necessary as those files shouldn't be generated.
131+
Copy-Item $modelsDirectory -Destination $env:repoModelsDir -Exclude Base*
132+
Write-Host "Copied the generated models\generated files into the repo. Excluded Base* files." -ForegroundColor Green
133+
134+
# models\extensions
135+
Copy-Item $modelsExtensionsDirectory -Destination $env:repoModelsExtensionDir
136+
Write-Host "Copied the generated models\extensions files into the repo." -ForegroundColor Green
137+
138+
# requests\extensions
139+
Copy-Item $requestsExtensionsDirectory -Destination $env:repoRequestExtensionDir
140+
Write-Host "Copied the generated requests\extensions files into the repo." -ForegroundColor Green
141+
142+
- task: PowerShell@2
143+
displayName: 'Git: stage and commit generated files'
144+
env: # [2]
145+
GIT_REDIRECT_STDERR: "2>&1"
146+
inputs:
147+
targetType: inline
148+
workingDirectory: '$(Build.SourcesDirectory)/msgraph-sdk-java'
149+
script: |
150+
Write-Host "About to add files....." -ForegroundColor Green
151+
git add . | Write-Host
152+
153+
if ($env:Build_Reason -eq 'Manual') # Skip CI if manually running this pipeline.
154+
{
155+
git commit -m "Update generated v1.0 Java models and requests with build $env:Build_BuildId [skip ci]" | Write-Host
156+
}
157+
else
158+
{
159+
git commit -m "Update generated v1.0 Java models and requests with build $env:Build_BuildId" | Write-Host
160+
}
161+
162+
Write-Host "Added and committed generated java files." -ForegroundColor Green
163+
164+
- task: PowerShell@2
165+
displayName: 'Git: push updates'
166+
env: # [2]
167+
GIT_REDIRECT_STDERR: "2>&1"
168+
inputs:
169+
targetType: inline
170+
workingDirectory: '$(Build.SourcesDirectory)/msgraph-sdk-java'
171+
script: |
172+
git push --set-upstream origin $env:branchName | Write-Host
173+
Write-Host "Pushed the results of the build to the $env:branchName branch." -ForegroundColor Green
174+
enabled: true
175+
176+
# Send a notification to our Graph Tooling channel to let us know that
177+
# that automated build failed. This won't notify on manual builds.
178+
179+
- task: YodLabs.O365PostMessage.O365PostMessageBuild.O365PostMessageBuild@0
180+
displayName: 'Graph Client Tooling pipeline fail notification'
181+
inputs:
182+
addressType: serviceEndpoint
183+
serviceEndpointName: 'microsoftgraph pipeline status'
184+
title: '$(Build.DefinitionName) failure notification'
185+
text: 'This automated pipeline has failed. View the build details for further information. This is a blocking failure.'
186+
condition: and(failed(), ne(variables['Build.Reason'], 'Manual')) # Only notify if the automated build failed.
187+
enabled: true
188+
189+
# References
190+
# [0] https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops#use-a-microsoft-hosted-agent
191+
# [1] https://github.com/actions/virtual-environments/blob/master/images/win/Windows2019-Readme.md
192+
# [2] https://github.com/actions/virtual-environments/issues/617#issuecomment-603664319
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# Licensed under the MIT License.
3+
4+
# This action will automatically create a pull request against master if the pushed branch
5+
# has a branch path spec likev 1.0/pipelinebuild/*. Configure this action by updating the
6+
# environment variable values[0].
7+
8+
name: "create pull request"
9+
10+
# Controls when the action will run. Triggers the workflow on push
11+
# events but only for branches with the following branch spec: "v1.0/pipelinebuild/*"
12+
on:
13+
push:
14+
branches:
15+
- "v1.0/pipelinebuild/*"
16+
17+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
18+
jobs:
19+
# This workflow contains a single job called "create-pull-request"
20+
create-pull-request:
21+
# GitHub Actions don't support skip ci yet like Azure Pipelines so this check will do the same.
22+
if: github.event_name == 'push' && contains(toJson(github.event.commits), '***NO_CI***') == false && contains(toJson(github.event.commits), '[ci skip]') == false && contains(toJson(github.event.commits), '[skip ci]') == false
23+
# The type of runner that the job will run on
24+
runs-on: ubuntu-latest
25+
# https://github.com/actions/virtual-environments/blob/master/images/linux/Ubuntu1804-README.md
26+
27+
# Steps represent a sequence of tasks that will be executed as part of the job
28+
steps:
29+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
30+
- uses: actions/checkout@v2
31+
32+
# Create a pull request [1]
33+
- name: Create PR using the GitHub REST API via hub
34+
shell: bash
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
MESSAGE_TITLE: Generated v1.0 models and request builders using Typewriter
38+
MESSAGE_BODY: "This pull request was automatically created by the GitHub Action, **${{github.workflow}}**. \n\n The commit hash is _${{github.sha}}_. \n\n **Important** Check for unexpected deletions or changes in this PR. \n\n cc: @darrelmiller"
39+
REVIEWERS: peombwa,ddyett
40+
ASSIGNEDTO: MIchaelMainer
41+
LABELS: generated
42+
BASE: dev
43+
run: |
44+
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1
45+
bin/hub pull-request -b "$BASE" -h "$GITHUB_REF" -m "$MESSAGE_TITLE" -m "$MESSAGE_BODY" -r "$REVIEWERS" -a "$ASSIGNEDTO" -l "$LABELS"
46+
# References
47+
# [0] https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables
48+
# [1] https://hub.github.com/hub-pull-request.1.html
49+
# https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token

.travis.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ mavenBintraySnapshotUrl = http://oss.jfrog.org/artifactory/oss-snapshot-local
2626
mavenGroupId = com.microsoft.graph
2727
mavenArtifactId = microsoft-graph
2828
mavenMajorVersion = 1
29-
mavenMinorVersion = 6
30-
mavenPatchVersion = 0
29+
mavenMinorVersion = 7
30+
mavenPatchVersion = 1
3131
mavenArtifactSuffix =
3232
nightliesUrl = http://dl.bintray.com/MicrosoftGraph/Maven
3333

src/main/java/com/microsoft/graph/core/Constants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ private Constants() {
2828
public static final String APPID = "app-id";
2929
public static final String USERNAME = "[email protected]";
3030
public static final String PASSWORD = "password";
31-
public static final String VERSION_NAME = "1.6.0";
31+
public static final String VERSION_NAME = "1.7.1";
3232
}
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
// ------------------------------------------------------------------------------
2+
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
3+
// ------------------------------------------------------------------------------
4+
5+
package com.microsoft.graph.models.extensions;
6+
import com.microsoft.graph.concurrency.*;
7+
import com.microsoft.graph.core.*;
8+
import com.microsoft.graph.http.*;
9+
import com.microsoft.graph.options.*;
10+
import com.microsoft.graph.serializer.*;
11+
import java.util.Arrays;
12+
import java.util.EnumSet;
13+
import com.microsoft.graph.models.extensions.MediaConfig;
14+
15+
16+
import com.google.gson.JsonObject;
17+
import com.google.gson.JsonElement;
18+
import com.google.gson.annotations.*;
19+
import java.util.HashMap;
20+
import java.util.Map;
21+
22+
// **NOTE** This file was generated by a tool and any changes will be overwritten.
23+
24+
/**
25+
* The class for the App Hosted Media Config.
26+
*/
27+
public class AppHostedMediaConfig extends MediaConfig implements IJsonBackedObject {
28+
29+
30+
/**
31+
* The Blob.
32+
*
33+
*/
34+
@SerializedName("blob")
35+
@Expose
36+
public String blob;
37+
38+
39+
/**
40+
* The raw representation of this class
41+
*/
42+
private JsonObject rawObject;
43+
44+
/**
45+
* The serializer
46+
*/
47+
private ISerializer serializer;
48+
49+
/**
50+
* Gets the raw representation of this class
51+
*
52+
* @return the raw representation of this class
53+
*/
54+
public JsonObject getRawObject() {
55+
return rawObject;
56+
}
57+
58+
/**
59+
* Gets serializer
60+
*
61+
* @return the serializer
62+
*/
63+
protected ISerializer getSerializer() {
64+
return serializer;
65+
}
66+
67+
/**
68+
* Sets the raw JSON object
69+
*
70+
* @param serializer the serializer
71+
* @param json the JSON object to set this object to
72+
*/
73+
public void setRawObject(final ISerializer serializer, final JsonObject json) {
74+
this.serializer = serializer;
75+
rawObject = json;
76+
77+
}
78+
}

0 commit comments

Comments
 (0)