Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
9e55b03
Merge pull request #37 from microsoftgraph/master
MIchaelMainer Jun 24, 2020
c7d8c7a
Update buildAndPackage.yml for Azure Pipelines
ramsessanchez Jun 25, 2020
5696713
Update buildAndPackage.yml for Azure Pipelines
ramsessanchez Jun 25, 2020
6b70c19
Update prValidate.yml for Azure Pipelines
ramsessanchez Jun 25, 2020
493d910
update script and rename folder from Scripts to scripts
ramsessanchez Jun 25, 2020
6f42ced
add getLatestVersion script
ramsessanchez Jun 25, 2020
eae025a
update the scripts
ramsessanchez Jun 25, 2020
3eee981
Update prValidate.yml for Azure Pipelines
ramsessanchez Jun 25, 2020
062a8d5
Update buildAndPackage.yml for Azure Pipelines
ramsessanchez Jun 25, 2020
1277760
Update buildAndPackage.yml for Azure Pipelines
ramsessanchez Jun 25, 2020
ff942d7
Update prValidate.yml for Azure Pipelines
ramsessanchez Jun 25, 2020
5ca7be8
Update prValidate.yml
ramsessanchez Jun 25, 2020
2b0f46b
Update prValidate.yml
ramsessanchez Jun 25, 2020
5d03a69
Merge pull request #39 from microsoftgraph/rsh/getVersionScript
ramsessanchez Jun 25, 2020
bbbac71
fixing small typo causing script to break
ramsessanchez Jun 26, 2020
7d711f0
Merge pull request #40 from microsoftgraph/rsh/scriptMinorUpdate
ramsessanchez Jun 26, 2020
f681866
- adds dependencies auto-update workflow
baywet Aug 19, 2020
76631dc
- adds conflicting PR workflow
baywet Aug 19, 2020
1bccc03
- adds codeql analysis workflow
baywet Aug 19, 2020
19c8af5
- adds issue template
baywet Aug 19, 2020
239b16c
- adds pull request template
baywet Aug 19, 2020
4134935
Merge pull request #46 from microsoftgraph/feature/workflows
baywet Aug 20, 2020
159a9ea
Bump json-simple from 1.1 to 1.1.1
dependabot[bot] Aug 20, 2020
cd978fd
Merge pull request #47 from microsoftgraph/dependabot/gradle/com.goog…
baywet Aug 20, 2020
fe53281
Bump junit from 4.12 to 4.13
dependabot[bot] Aug 20, 2020
59bcc4a
Merge pull request #50 from microsoftgraph/dependabot/gradle/junit-ju…
baywet Aug 20, 2020
9fb8987
- closes #49 removes a unused dependency
baywet Aug 24, 2020
45e012c
- bumps version to 1.0.2
baywet Aug 24, 2020
fc8daf1
Merge pull request #51 from microsoftgraph/feature/useless-dep
baywet Aug 24, 2020
1f65d4d
Merge branch 'dev' into feature/version1-0-2
baywet Aug 24, 2020
b04bbb7
Merge pull request #52 from microsoftgraph/feature/version1-0-2
baywet Aug 24, 2020
6465a6f
- fixes an issue where maven version would not be compared
baywet Aug 31, 2020
c4e8d99
- removes unused dependency
baywet Aug 31, 2020
9256135
- upgrades gradle from 4.5 to 6.6
baywet Aug 31, 2020
81569a5
Apply suggestions from code review
baywet Aug 31, 2020
8adaed2
Merge pull request #54 from microsoftgraph/bugfix/versionvalidation-i…
baywet Aug 31, 2020
75c2281
Merge branch 'dev' into feature/gradle-upgrade
baywet Aug 31, 2020
6f87c0b
Merge branch 'dev' into feature/math-dep-remove
baywet Aug 31, 2020
509ad9a
Merge pull request #55 from microsoftgraph/feature/math-dep-remove
baywet Aug 31, 2020
8493cc3
- names repostories and moves urls to build file for clarity
baywet Aug 31, 2020
5e58100
Merge branch 'dev' into feature/gradle-upgrade
baywet Aug 31, 2020
ce51737
- adds missing bintray repo
baywet Aug 31, 2020
4e8c24f
- replaces hardcoded constants by settings loading
baywet Sep 1, 2020
4bacea5
- fixes a bug where parameters docs would fail the script
baywet Sep 1, 2020
bd10064
- bumps java version in the readme and lints readme
baywet Sep 1, 2020
832d55b
- reverts upgrade to java8 to avoid introducing a breaking change
baywet Sep 1, 2020
883c420
Merge pull request #57 from microsoftgraph/bugfix/getLatestVersionScr…
baywet Sep 1, 2020
c8298b5
Merge branch 'dev' into feature/gradle-upgrade
baywet Sep 1, 2020
8c480ee
Merge pull request #56 from microsoftgraph/feature/gradle-upgrade
baywet Sep 1, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .azure-pipelines/buildAndPackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ trigger:
- gradlew.bat
- readme.md
- settings.gradle
- Scripts/*

pr: none

Expand Down Expand Up @@ -82,6 +83,7 @@ steps:
settings.gradle
gradle.properties
**/gradle/wrapper/*
Scripts/getLatestVersion.ps1
TargetFolder: '$(Build.ArtifactStagingDirectory)/'

- task: PublishBuildArtifacts@1
Expand Down
9 changes: 7 additions & 2 deletions .azure-pipelines/prValidate.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Build and test Java Core to make sure a valid pull request is being made
#Copyright (c) Microsoft Corporation. All rights reserved.
#Licensed under the MIT License.
#Build and test Java Core to make sure a valid pull request is being made
#Validate that the versions dont conflict with those online in case a pull request is made to main or master

pr:
branches:
include:
Expand All @@ -18,6 +22,7 @@ pr:
- gradlew.bat
- readme.md
- settings.gradle
- Scripts/*

trigger: none # disable triggers based on commits.

Expand Down Expand Up @@ -62,4 +67,4 @@ steps:
title: '$(Build.DefinitionName) failure notification'
text: 'This pipeline has failed. View the build details for further information. This is a blocking failure. '
condition: and(failed(), ne(variables['Build.Reason'], 'Manual'))
enabled: true
enabled: true
37 changes: 37 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!-- Read me before you submit this issue

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.

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.
https://stackoverflow.com/questions/tagged/microsoft-graph

This repo is for the Microsoft Graph Java SDK. Issues opened in this repo should only target this SDK.

Before you open this issue, did you:
- Search the issues to determine whether someone already opened this issue?
- Search StackOverflow for an answer?
- Capture the repro steps and gather the information requested in the steps below to reproduce your scenario?
- Review the samples under github.com/microsoftgraph? They can help for some scenarios.
- 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)

Please provide the following before submitting this issue:
- 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.
- 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).
- 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.
-->

### Expected behavior




### Actual behavior




### Steps to reproduce the behavior




19 changes: 19 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!-- Read me before you submit this pull request

First off, thank you for opening this pull request! We do appreciate it.

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
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.

-->

<!-- Optional. Set the issues that this pull request fixes. Delete 'Fixes #' if there isn't an issue associated with this pull request. -->
Fixes #

<!-- Required. Provide specifics about what the changes are and why you're proposing these changes. -->
### Changes proposed in this pull request
-

<!-- Optional. Provide related links. This might be other pull requests, code files, StackOverflow posts. Delete this section if it is not used. -->
### Other links
-
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
updates:
- package-ecosystem: gradle
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
- package-ecosystem: maven
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
54 changes: 54 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: "CodeQL"

on:
push:
branches: [dev, master]
pull_request:
# The branches below must be a subset of the branches above
branches: [dev]
schedule:
- cron: '0 1 * * 4'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
# Override language selection by uncommenting this and choosing your languages
with:
languages: java

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
34 changes: 34 additions & 0 deletions .github/workflows/conflicting-pr-label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This is a basic workflow to help you get started with Actions

name: PullRequestConflicting

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master, dev ]
pull_request:
types: [synchronize]
branches: [ master, dev ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: check if prs are dirty
uses: eps1lon/actions-label-merge-conflict@releases/2.x
if: env.LABELING_TOKEN != '' && env.LABELING_TOKEN != null
id: check
with:
dirtyLabel: "conflicting"
repoToken: "${{ secrets.GITHUB_TOKEN }}"
continueOnMissingPermissions: true
commentOnDirty: 'This pull request has conflicting changes, the author must resolve the conflicts before this pull request can be merged.'
commentOnClean: 'Conflicts have been resolved. A maintainer will take a look shortly.'
env:
LABELING_TOKEN: ${{secrets.GITHUB_TOKEN }}
31 changes: 31 additions & 0 deletions Scripts/getLatestVersion.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

<#
.Synopsis
Retrieve the latest version of the library
.Description
Retrieves the latest version specified in the Gradle.Properties file
Uses the retrieved values to update the enviornment variable VERSION_STRING
.Parameter propertiesPath
#>
Param(
[string]$propertiesPath
)

#Retrieve the current version from the Gradle.Properties file given the specified path
if($propertiesPath -eq "" -or $null -eq $propertiesPath) {
$propertiesPath = Join-Path -Path $PSScriptRoot -ChildPath "../gradle.properties"
}
$file = get-item $propertiesPath
$findVersions = $file | Select-String -Pattern "mavenMajorVersion" -Context 0,2
$findVersions = $findVersions -split "`r`n"

$majorVersion = $findVersions[0].Substring($findVersions[0].Length-1)
$minorVersion = $findVersions[1].Substring($findVersions[1].Length-1)
$patchVersion = $findVersions[2].Substring($findVersions[2].Length-1)
$version = "$majorVersion.$minorVersion.$patchVersion"

#Update the VERSION_STRING env variable and inform the user
Write-Host "##vso[task.setVariable variable=VERSION_STRING]$($version)";
Write-Host "Updated the VERSION_STRING enviornment variable with the current Gradle.Properties, $version"
27 changes: 17 additions & 10 deletions Scripts/validateMavenVersion.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,22 @@
Retrieves the local, Maven, and Bintray versions of the Java-Core build.
Checks that the Maven and Bintray versions are aligned, trigger warning if not.
Checks that the current local version is greater than those currently deployed.
.Parameter propertiesPath
#>

.Parameter packageName
.Parameter propertiesPath

Param(
[parameter(Mandatory = $true)]
[string]$packageName,

[parameter(Mandatory = $true)]
[string]$propertiesPath
)

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

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

#If the api calls return empty then this library cannot be compared to the online versions
#may proceed with the pull request
if(($mavenVersion -eq $null) -and ($bintrayVersion -eq $null))
{
Write-Information "This package does not exist yet in the online repository, therefore there are no versions to compare."
return
}

#Inform host of current Maven and Bintray versions
write-host 'The current version in the Maven central repository is:' $mavenVersion
write-host 'The current version in the Bintray central repository is:' $bintrayVersion
Write-Host 'The current version in the Maven central repository is:' $mavenVersion
Write-Host 'The current version in the Bintray central repository is:' $bintrayVersion

#Warn in case Maven and Bintray versions are not the same.
if($mavenVersion -ne $bintrayVersion){
Write-Warning "The current Maven and Bintray versions are not the same"
}
#Success if Local version has been updated, Error otherwise.
if($localVersion -gt $bintrayVersion){
if($localVersion -gt $bintrayVersion -and $localVersion -gt $mavenVersion){
Write-Host "The current pull request is of a greater version"
}
else{
Write-Error "The current local version is not updated. Please update the local version in the Gradle.Properties file."
}
}
Loading