Skip to content

Commit 5d7bc60

Browse files
authored
Merge pull request #53 from microsoftgraph/dev
release/1.0.2
2 parents 3cc93aa + 8c480ee commit 5d7bc60

File tree

18 files changed

+362
-203
lines changed

18 files changed

+362
-203
lines changed

.azure-pipelines/buildAndPackage.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ trigger:
2323
- gradlew.bat
2424
- readme.md
2525
- settings.gradle
26+
- Scripts/*
2627

2728
pr: none
2829

@@ -82,6 +83,7 @@ steps:
8283
settings.gradle
8384
gradle.properties
8485
**/gradle/wrapper/*
86+
Scripts/getLatestVersion.ps1
8587
TargetFolder: '$(Build.ArtifactStagingDirectory)/'
8688

8789
- task: PublishBuildArtifacts@1

.azure-pipelines/prValidate.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# Build and test Java Core to make sure a valid pull request is being made
1+
#Copyright (c) Microsoft Corporation. All rights reserved.
2+
#Licensed under the MIT License.
3+
#Build and test Java Core to make sure a valid pull request is being made
4+
#Validate that the versions dont conflict with those online in case a pull request is made to main or master
5+
26
pr:
37
branches:
48
include:
@@ -18,6 +22,7 @@ pr:
1822
- gradlew.bat
1923
- readme.md
2024
- settings.gradle
25+
- Scripts/*
2126

2227
trigger: none # disable triggers based on commits.
2328

@@ -62,4 +67,4 @@ steps:
6267
title: '$(Build.DefinitionName) failure notification'
6368
text: 'This pipeline has failed. View the build details for further information. This is a blocking failure. '
6469
condition: and(failed(), ne(variables['Build.Reason'], 'Manual'))
65-
enabled: true
70+
enabled: true

.github/ISSUE_TEMPLATE.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<!-- Read me before you submit this issue
2+
3+
First off, thank you for taking the time to open this issue! We do appreciate it. Please bear with us if we don't get to this right away.
4+
5+
If this is a question about the Microsoft Graph service API, or a question about how to use this SDK, please post your question to StackOverflow with the [microsoftgraph] tag.
6+
https://stackoverflow.com/questions/tagged/microsoft-graph
7+
8+
This repo is for the Microsoft Graph Java SDK. Issues opened in this repo should only target this SDK.
9+
10+
Before you open this issue, did you:
11+
- Search the issues to determine whether someone already opened this issue?
12+
- Search StackOverflow for an answer?
13+
- Capture the repro steps and gather the information requested in the steps below to reproduce your scenario?
14+
- Review the samples under github.com/microsoftgraph? They can help for some scenarios.
15+
- Take a look at the functional tests in this repo? They may have an example for you. See the [functional tests](https://github.com/microsoftgraph/msgraph-sdk-java/tree/master/src/test/java/com/microsoft/graph/functional)
16+
17+
Please provide the following before submitting this issue:
18+
- Expected behavior. Please provide **links to the specific [Microsoft Graph documentation](https://developer.microsoft.com/en-us/graph/docs/concepts/overview)** you used to determine the expected behavior.
19+
- Actual behavior. Provide error codes, stack information, and a [Fiddler](http://www.telerik.com/fiddler) capture of the request and response (please remove personally identifiable information before posting).
20+
- Steps to reproduce the behavior. Include your code, IDE versions, client library versions, and any other information that might be helpful to understand your scenario.
21+
-->
22+
23+
### Expected behavior
24+
25+
26+
27+
28+
### Actual behavior
29+
30+
31+
32+
33+
### Steps to reproduce the behavior
34+
35+
36+
37+

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!-- Read me before you submit this pull request
2+
3+
First off, thank you for opening this pull request! We do appreciate it.
4+
5+
The requests and models for this client library are generated. We won't be accepting pull requests for those code files. With that said, we do appreciate
6+
it when you open pull requests with the proposed file changes, as we'll use that to help guide us in updating our template files.
7+
8+
-->
9+
10+
<!-- Optional. Set the issues that this pull request fixes. Delete 'Fixes #' if there isn't an issue associated with this pull request. -->
11+
Fixes #
12+
13+
<!-- Required. Provide specifics about what the changes are and why you're proposing these changes. -->
14+
### Changes proposed in this pull request
15+
-
16+
17+
<!-- Optional. Provide related links. This might be other pull requests, code files, StackOverflow posts. Delete this section if it is not used. -->
18+
### Other links
19+
-

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: gradle
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
open-pull-requests-limit: 10
8+
- package-ecosystem: maven
9+
directory: "/"
10+
schedule:
11+
interval: daily
12+
open-pull-requests-limit: 10
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [dev, master]
6+
pull_request:
7+
# The branches below must be a subset of the branches above
8+
branches: [dev]
9+
schedule:
10+
- cron: '0 1 * * 4'
11+
12+
jobs:
13+
analyze:
14+
name: Analyze
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v2
20+
with:
21+
# We must fetch at least the immediate parents so that if this is
22+
# a pull request then we can checkout the head.
23+
fetch-depth: 2
24+
25+
# If this run was triggered by a pull request event, then checkout
26+
# the head of the pull request instead of the merge commit.
27+
- run: git checkout HEAD^2
28+
if: ${{ github.event_name == 'pull_request' }}
29+
30+
# Initializes the CodeQL tools for scanning.
31+
- name: Initialize CodeQL
32+
uses: github/codeql-action/init@v1
33+
# Override language selection by uncommenting this and choosing your languages
34+
with:
35+
languages: java
36+
37+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
38+
# If this step fails, then you should remove it and run the build manually (see below)
39+
- name: Autobuild
40+
uses: github/codeql-action/autobuild@v1
41+
42+
# ℹ️ Command-line programs to run using the OS shell.
43+
# 📚 https://git.io/JvXDl
44+
45+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
46+
# and modify them (or add more) to build your code if your project
47+
# uses a compiled language
48+
49+
#- run: |
50+
# make bootstrap
51+
# make release
52+
53+
- name: Perform CodeQL Analysis
54+
uses: github/codeql-action/analyze@v1
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: PullRequestConflicting
4+
5+
# Controls when the action will run. Triggers the workflow on push or pull request
6+
# events but only for the master branch
7+
on:
8+
push:
9+
branches: [ master, dev ]
10+
pull_request:
11+
types: [synchronize]
12+
branches: [ master, dev ]
13+
14+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
15+
jobs:
16+
# This workflow contains a single job called "build"
17+
build:
18+
# The type of runner that the job will run on
19+
runs-on: ubuntu-latest
20+
21+
# Steps represent a sequence of tasks that will be executed as part of the job
22+
steps:
23+
- name: check if prs are dirty
24+
uses: eps1lon/actions-label-merge-conflict@releases/2.x
25+
if: env.LABELING_TOKEN != '' && env.LABELING_TOKEN != null
26+
id: check
27+
with:
28+
dirtyLabel: "conflicting"
29+
repoToken: "${{ secrets.GITHUB_TOKEN }}"
30+
continueOnMissingPermissions: true
31+
commentOnDirty: 'This pull request has conflicting changes, the author must resolve the conflicts before this pull request can be merged.'
32+
commentOnClean: 'Conflicts have been resolved. A maintainer will take a look shortly.'
33+
env:
34+
LABELING_TOKEN: ${{secrets.GITHUB_TOKEN }}

Scripts/getLatestVersion.ps1

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# Licensed under the MIT License.
3+
4+
<#
5+
.Synopsis
6+
Retrieve the latest version of the library
7+
.Description
8+
Retrieves the latest version specified in the Gradle.Properties file
9+
Uses the retrieved values to update the enviornment variable VERSION_STRING
10+
.Parameter propertiesPath
11+
#>
12+
Param(
13+
[string]$propertiesPath
14+
)
15+
16+
#Retrieve the current version from the Gradle.Properties file given the specified path
17+
if($propertiesPath -eq "" -or $null -eq $propertiesPath) {
18+
$propertiesPath = Join-Path -Path $PSScriptRoot -ChildPath "../gradle.properties"
19+
}
20+
$file = get-item $propertiesPath
21+
$findVersions = $file | Select-String -Pattern "mavenMajorVersion" -Context 0,2
22+
$findVersions = $findVersions -split "`r`n"
23+
24+
$majorVersion = $findVersions[0].Substring($findVersions[0].Length-1)
25+
$minorVersion = $findVersions[1].Substring($findVersions[1].Length-1)
26+
$patchVersion = $findVersions[2].Substring($findVersions[2].Length-1)
27+
$version = "$majorVersion.$minorVersion.$patchVersion"
28+
29+
#Update the VERSION_STRING env variable and inform the user
30+
Write-Host "##vso[task.setVariable variable=VERSION_STRING]$($version)";
31+
Write-Host "Updated the VERSION_STRING enviornment variable with the current Gradle.Properties, $version"

Scripts/validateMavenVersion.ps1

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,22 @@
99
Retrieves the local, Maven, and Bintray versions of the Java-Core build.
1010
Checks that the Maven and Bintray versions are aligned, trigger warning if not.
1111
Checks that the current local version is greater than those currently deployed.
12+
.Parameter propertiesPath
1213
#>
1314

14-
.Parameter packageName
15-
.Parameter propertiesPath
1615

1716
Param(
18-
[parameter(Mandatory = $true)]
19-
[string]$packageName,
20-
21-
[parameter(Mandatory = $true)]
2217
[string]$propertiesPath
2318
)
2419

2520
#Find the local version from the Gradle.Properties file
21+
if($propertiesPath -eq "" -or $null -eq $propertiesPath) {
22+
$propertiesPath = Join-Path -Path $PSScriptRoot -ChildPath "../gradle.properties"
23+
}
2624
$file = get-item $propertiesPath
2725
$findLocalVersions = $file | Select-String -Pattern "mavenMajorVersion" -Context 0,2
2826
$findLocalVersions = $findLocalVersions -split "`r`n"
27+
$packageName = ($file | Select-String -Pattern "mavenArtifactId").Line.Split("=")[1].Trim()
2928

3029
$localMajor = $findLocalVersions[0].Substring($findLocalVersions[0].Length-1)
3130
$localMinor = $findLocalVersions[1].Substring($findLocalVersions[1].Length-1)
@@ -43,18 +42,26 @@ $bintrayAPIurl = "https://api.bintray.com/search/packages?name=$packageName"
4342
$jsonResult = $web_client.DownloadString($bintrayAPIurl) | ConvertFrom-Json
4443
$bintrayVersion = [version]$jsonResult.latest_version
4544

45+
#If the api calls return empty then this library cannot be compared to the online versions
46+
#may proceed with the pull request
47+
if(($mavenVersion -eq $null) -and ($bintrayVersion -eq $null))
48+
{
49+
Write-Information "This package does not exist yet in the online repository, therefore there are no versions to compare."
50+
return
51+
}
52+
4653
#Inform host of current Maven and Bintray versions
47-
write-host 'The current version in the Maven central repository is:' $mavenVersion
48-
write-host 'The current version in the Bintray central repository is:' $bintrayVersion
54+
Write-Host 'The current version in the Maven central repository is:' $mavenVersion
55+
Write-Host 'The current version in the Bintray central repository is:' $bintrayVersion
4956

5057
#Warn in case Maven and Bintray versions are not the same.
5158
if($mavenVersion -ne $bintrayVersion){
5259
Write-Warning "The current Maven and Bintray versions are not the same"
5360
}
5461
#Success if Local version has been updated, Error otherwise.
55-
if($localVersion -gt $bintrayVersion){
62+
if($localVersion -gt $bintrayVersion -and $localVersion -gt $mavenVersion){
5663
Write-Host "The current pull request is of a greater version"
5764
}
5865
else{
5966
Write-Error "The current local version is not updated. Please update the local version in the Gradle.Properties file."
60-
}
67+
}

0 commit comments

Comments
 (0)