Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #34

Merged
merged 46 commits into from
Jun 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
1ce38e5
Added IsNewAndShouldBePosted and IsNewAndShouldBeStored.
marcduiker Mar 8, 2019
f329356
Added azure-functions-durable-js
marcduiker Mar 8, 2019
32e2418
Added feature toggle DoPostUpdate
marcduiker Mar 17, 2019
83fb15c
Fixed issue with determining IsNewAndShouldBeStored for NullReleases …
marcduiker Mar 17, 2019
bcede08
Changed to strict mock behaviour
marcduiker Mar 17, 2019
98f61bd
Added current content of AzFuncUpdatesConfiguration table
marcduiker Mar 17, 2019
c164079
Added functionality to handle RSS feeds.
marcduiker Mar 17, 2019
24bd762
Added reference to Microsoft.SyndicationFeed.ReaderWriter
marcduiker Mar 17, 2019
2edc11f
Extracted message building to seperate class.
marcduiker Mar 17, 2019
049d29a
Added hashtags to publication
marcduiker Mar 17, 2019
1259aaa
Renamed url property
marcduiker Mar 17, 2019
b17a7a1
Final changes for updates for RSS publications
marcduiker Mar 20, 2019
07a387a
Updated docs and config
marcduiker Mar 20, 2019
b4ca68a
Fixed typo
marcduiker Mar 20, 2019
38f7ded
Clarification about the RSS feed
marcduiker Mar 20, 2019
7ade736
Updated models and orchestrations to prevent posting tweets when savi…
marcduiker Mar 23, 2019
0c36335
Added code to sanitize Partition- and Rowkeys. Refactored to use buil…
marcduiker Mar 24, 2019
db4cbb8
Extra logging for publications
marcduiker Mar 27, 2019
2f47d7d
Fixed incorrect tablename
marcduiker Apr 19, 2019
3554b49
Added logging when release is found
marcduiker Apr 19, 2019
8d6b10f
Ensured partitionKey is sanitized when used in query
marcduiker Apr 19, 2019
dbe0b9b
Added GitHub repositories
marcduiker Apr 19, 2019
9497fcc
Added GitHub repositories
marcduiker Apr 19, 2019
c36c97e
Removed empty line to fix formatting
marcduiker Apr 29, 2019
a737d72
Changed to Release.GetAll() with ApiOptions in order to get prereleas…
marcduiker Apr 29, 2019
68e663a
Code formatting
marcduiker Apr 29, 2019
3fad2b8
Prereleases are still not found, reverted to previous implementation …
marcduiker Apr 29, 2019
50a3592
Ensure key sanatization is done in constructors.
marcduiker Apr 29, 2019
993d767
Changed RepositoryRelease to use PublishedAt date if it exists.
marcduiker Apr 29, 2019
3703bba
Updated packages
marcduiker May 9, 2019
65fd4a4
Using GetAll to also retrieve prereleases.
marcduiker May 9, 2019
3204704
removed usings
marcduiker May 9, 2019
1179302
Extended MaxDays to 3 to allow notification of updates during Build c…
marcduiker May 9, 2019
fd1bfdd
Added vscode-azurefunctions as repo source
marcduiker Jul 8, 2019
6c220f8
Updated dependencies and added function to put UpdateMessage objects …
marcduiker Aug 7, 2019
1c2399b
Added logic to MessageBuilder to handle messages with length > 255 ch…
marcduiker Sep 18, 2019
13f41f9
Added new sources
marcduiker Sep 20, 2019
ca710b8
Added repositories which will be monitored
marcduiker Dec 1, 2019
f4ed2f9
Upgrade to Functions Runtime v3 and DF v2
marcduiker Jan 22, 2020
00cf0af
Refactoring in order to do a fan out over both GitHub and History rel…
marcduiker Jan 22, 2020
c64bb71
Refactored orchestration to improve readability
marcduiker Jan 23, 2020
6204060
Added Activity postfix. Added RetryOptionsBuilder.
marcduiker Jan 24, 2020
2753d46
Added azure-functions-deno-worker repo
marcduiker May 25, 2020
c11daed
Updated packages and fixed date format not to be dependent on OS
marcduiker May 25, 2020
3060f9b
Refactor after upgrading to new versions of dependencies
marcduiker Jun 15, 2020
75f6d88
Removed NullRelease, Using only GitHubRelease and HistoryRelease now.
marcduiker Jun 19, 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
28 changes: 28 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/src/AzureFunctionsUpdates.UnitTests/bin/Debug/netcoreapp2.2/AzureFunctionsUpdates.UnitTests.dll",
"args": [],
"cwd": "${workspaceFolder}/src/AzureFunctionsUpdates.UnitTests",
// For more information about the 'console' field, see https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window
"console": "internalConsole",
"stopAtEntry": false,
"internalConsoleOptions": "openOnSessionStart"
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
}
,]
}
15 changes: 15 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/src/AzureFunctionsUpdates.UnitTests/AzureFunctionsUpdates.UnitTests.csproj"
],
"problemMatcher": "$msCompile"
}
]
}
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@

This repository contains the code for the [Azure Functions Updates Twitterbot](https://twitter.com/az_func_updates).

Currently this bot checks Azure Functions related GitHub repoistories for new releases every hour.
Currently this bot checks for:
- New releases in Azure Functions related GitHub repositories.
- New posts, related to Azure Functions, in the Azure Service Updates RSS feed.

You can read all about how the creation of this application [here](https://blog.marcduiker.nl/2019/03/03/creating-azure-functions-updates-twitterbot.html).
You can read all about the creation of this application [here](https://blog.marcduiker.nl/2019/03/03/creating-azure-functions-updates-twitterbot.html).

## Other docs

- [List of GitHub repositories](/docs/monitored-repositories.md) being monitored
- [List of sources](/docs/monitored-sources.md) being monitored

## Issues & Feature requests

Expand Down
6 changes: 6 additions & 0 deletions api-tests/GitHub.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
### Get the latest release for a GitHub repository
@owner = azure
@repo = azure-functions-host

@baseUrl = https://api.github.com
GET {{baseUrl}}/repos/{{owner}}/{{repo}}/releases/latest
16 changes: 16 additions & 0 deletions api-tests/Status.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@appName =
@functionAppUrl = https://{{appName}}.azurewebsites.net
@code =
@taskHub = AzFuncUpdatesV130

GET {{functionAppUrl}}/runtime/webhooks/durableTask/instances
?taskHub={{taskHub}}
&code={{code}}
&runtimeStatus=Failed
&showInput=true
&top=50

### Purge failed instances
DELETE {{functionAppUrl}}/runtime/webhooks/durabletask/instances
?taskHub={{taskHub}}
&code={{code}}
26 changes: 26 additions & 0 deletions config/AzFuncUpdatesConfigurations.typed.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
PartitionKey,RowKey,Timestamp,CreatedAt,CreatedAt@type,HashTags,HashTags@type,IsActive,IsActive@type,PublicationSourceName,PublicationSourceName@type,PublicationSourceOwner,PublicationSourceOwner@type,PublicationSourceUrl,PublicationSourceUrl@type,RepositoryName,RepositoryName@type,RepositoryOwner,RepositoryOwner@type
Publications,Azure|Azure Service Updates,2019-03-20T21:55:31.405Z,2019-03-17T17:05:00.000Z,Edm.DateTime,#AzureFunctions #Serverless,Edm.String,true,Edm.Boolean,Azure Service Updates,Edm.String,Azure,Edm.String,https://azurecomcdn.azureedge.net/en-us/updates/feed/?product=functions,Edm.String,,,,
Repositories,Azure|azure-functions-core-tools,2019-03-08T21:12:46.700Z,2019-02-27T17:40:00.000Z,Edm.DateTime,#Azure #AzureFunctions #Serverless,Edm.String,true,Edm.Boolean,,,,,,,azure-functions-core-tools,Edm.String,Azure,Edm.String
Repositories,Azure|azure-functions-datalake-extension,2019-04-19T12:55:47.373Z,2019-04-19T14:55:00.000Z,Edm.DateTime,#Azure #AzureFunctions #Serverless,Edm.String,true,Edm.Boolean,,,,,,,azure-functions-datalake-extension,Edm.String,Azure,Edm.String
Repositories,Azure|azure-functions-docker,2019-03-08T21:12:46.700Z,2019-03-04T17:07:00.000Z,Edm.DateTime,#Azure #AzureFunctions #Serverless #Docker,Edm.String,true,Edm.Boolean,,,,,,,azure-functions-docker,Edm.String,Azure,Edm.String
Repositories,Azure|azure-functions-durable-extension,2019-03-08T21:12:46.700Z,2019-02-27T17:44:00.000Z,Edm.DateTime,#Azure #AzureFunctions #DurableFunctions #Serverless,Edm.String,true,Edm.Boolean,,,,,,,azure-functions-durable-extension,Edm.String,Azure,Edm.String
Repositories,Azure|azure-functions-durable-js,2019-03-08T21:33:47.752Z,2019-03-08T22:33:00.000Z,Edm.DateTime,#Azure #AzureFunctions #DurableFunctions #Serverless,Edm.String,true,Edm.Boolean,,,,,,,azure-functions-durable-js,Edm.String,Azure,Edm.String
Repositories,Azure|azure-functions-eventgrid-extension,2019-03-08T21:12:46.700Z,2019-02-28T15:45:00.000Z,Edm.DateTime,#Azure #AzureFunctions #Serverless,Edm.String,true,Edm.Boolean,,,,,,,azure-functions-eventgrid-extension,Edm.String,Azure,Edm.String
Repositories,Azure|azure-functions-host,2019-04-19T12:44:03.617Z,2019-02-13T23:14:40.371Z,Edm.DateTime,#Azure #AzureFunctions #Serverless,Edm.String,true,Edm.Boolean,,,,,,,azure-functions-host,Edm.String,Azure,Edm.String
Repositories,Azure|azure-functions-java-library,2019-03-08T21:12:46.700Z,2019-03-04T20:58:00.000Z,Edm.DateTime,#Azure #AzureFunctions #Serverless #Java,Edm.String,true,Edm.Boolean,,,,,,,azure-functions-java-library,Edm.String,Azure,Edm.String
Repositories,Azure|azure-functions-java-worker,2019-03-08T21:12:46.700Z,2019-03-04T20:59:00.000Z,Edm.DateTime,#Azure #AzureFunctions #Serverless #Java,Edm.String,true,Edm.Boolean,,,,,,,azure-functions-java-worker,Edm.String,Azure,Edm.String
Repositories,Azure|azure-functions-kafka-extension,2019-04-19T12:53:07.009Z,2019-04-19T14:52:00.000Z,Edm.DateTime,#Azure #AzureFunctions #Serverless,Edm.String,true,Edm.Boolean,,,,,,,azure-functions-kafka-extension,Edm.String,Azure,Edm.String
Repositories,Azure|azure-functions-microsoftgraph-extension,2019-04-19T12:51:47.784Z,2019-04-19T14:51:00.000Z,Edm.DateTime,#Azure #AzureFunctions #Serverless,Edm.String,true,Edm.Boolean,,,,,,,azure-functions-microsoftgraph-extension,Edm.String,Azure,Edm.String
Repositories,Azure|azure-functions-nodejs-worker,2019-03-08T21:12:46.700Z,2019-03-03T16:28:00.000Z,Edm.DateTime,#Azure #AzureFunctions #Serverless #NodeJS #TypeScript,Edm.String,true,Edm.Boolean,,,,,,,azure-functions-nodejs-worker,Edm.String,Azure,Edm.String
Repositories,Azure|azure-functions-pack,2019-04-19T12:50:15.598Z,2019-04-19T14:49:00.000Z,Edm.DateTime,#Azure #AzureFunctions #Serverless #NodeJS,Edm.String,true,Edm.Boolean,,,,,,,azure-functions-pack,Edm.String,Azure,Edm.String
Repositories,Azure|azure-functions-powershell-worker,2019-03-08T21:33:54.838Z,2019-03-04T19:45:00.000Z,Edm.DateTime,#Azure #AzureFunctions #Serverless #PowerShell,Edm.String,true,Edm.Boolean,,,,,,,azure-functions-powershell-worker,Edm.String,Azure,Edm.String
Repositories,Azure|azure-functions-python-library,2019-04-19T12:54:27.858Z,2019-04-19T14:53:00.000Z,Edm.DateTime,#Azure #AzureFunctions #Serverless,Edm.String,true,Edm.Boolean,,,,,,,azure-functions-python-library,Edm.String,Azure,Edm.String
Repositories,Azure|azure-functions-python-worker,2019-03-08T21:12:46.700Z,2019-03-04T17:06:00.000Z,Edm.DateTime,#Azure #AzureFunctions #Serverless #Python,Edm.String,true,Edm.Boolean,,,,,,,azure-functions-python-worker,Edm.String,Azure,Edm.String
Repositories,Azure|azure-functions-signalrservice-extension,2019-03-08T21:12:46.700Z,2019-02-28T15:51:00.000Z,Edm.DateTime,#Azure #AzureFunctions #Serverless,Edm.String,true,Edm.Boolean,,,,,,,azure-functions-signalrservice-extension,Edm.String,Azure,Edm.String
Repositories,Azure|azure-functions-templates,2019-03-08T21:12:46.700Z,2019-02-27T17:42:00.000Z,Edm.DateTime,#Azure #AzureFunctions #Serverless,Edm.String,true,Edm.Boolean,,,,,,,azure-functions-templates,Edm.String,Azure,Edm.String
Repositories,Azure|azure-functions-ux,2019-03-08T21:12:46.700Z,2019-03-04T17:04:00.000Z,Edm.DateTime,#Azure #Portal #AzureFunctions #Serverless,Edm.String,true,Edm.Boolean,,,,,,,azure-functions-ux,Edm.String,Azure,Edm.String
Repositories,Azure|azure-functions-vs-build-sdk,2019-03-08T21:12:46.700Z,2019-03-04T16:56:00.000Z,Edm.DateTime,#Azure #AzureFunctions #Serverless #MSBuild,Edm.String,true,Edm.Boolean,,,,,,,azure-functions-vs-build-sdk,Edm.String,Azure,Edm.String
Repositories,Azure|azure-webjobs-sdk,2019-03-08T21:12:46.700Z,2019-02-27T22:58:00.000Z,Edm.DateTime,#Azure #AzureFunctions #Serverless,Edm.String,true,Edm.Boolean,,,,,,,azure-webjobs-sdk,Edm.String,Azure,Edm.String
Repositories,Azure|azure-webjobs-sdk-extensions,2019-03-08T21:12:46.700Z,2019-02-28T15:40:00.000Z,Edm.DateTime,#Azure #AzureFunctions #Serverless,Edm.String,true,Edm.Boolean,,,,,,,azure-webjobs-sdk-extensions,Edm.String,Azure,Edm.String
Repositories,marcduiker|az-func-updates,2019-03-20T22:22:55.285Z,2019-03-20T23:12:00.000Z,Edm.DateTime,#AzureFunctions #Twitterbot #MetaTweet #SelfReflection,Edm.String,true,Edm.Boolean,,,,,,,az-func-updates,Edm.String,marcduiker,Edm.String
Repositories,microsoft|vscode-azurefunctions,2019-07-08T10:36:01.944Z,2019-07-08T12:35:00.000Z,Edm.DateTime,#AzureFunctions #Serverless @code,Edm.String,true,Edm.Boolean,,,,,,,vscode-azurefunctions,Edm.String,microsoft,Edm.String
20 changes: 0 additions & 20 deletions docs/monitored-repositories.md

This file was deleted.

48 changes: 48 additions & 0 deletions docs/monitored-sources.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# These are sources being monitored

## GitHub Repositories

| Owner | Repository name |
|-|-|
|anthonychu|azure-functions-deno-worker|
|Azure|azure-functions-appinsights-extension|
|Azure|azure-functions-core-tools|
|Azure|azure-functions-docker|
|Azure|azure-functions-datalake-extension|
|Azure|azure-functions-dotnet-extensions|
|Azure|azure-functions-durable-extension|
|Azure|azure-functions-durable-js|
|Azure|azure-functions-eventgrid-extension|
|Azure|azure-functions-eventhubs-extension|
|Azure|azure-functions-extension-bundles|
|Azure|azure-functions-host|
|Azure|azure-functions-iothub-extension|
|Azure|azure-functions-java-library|
|Azure|azure-functions-java-worker|
|Azure|azure-functions-kafka-extension|
|Azure|azure-functions-language-worker-protobuf|
|Azure|azure-functions-microsoftgraph-extension|
|Azure|azure-functions-nodejs-worker|
|Azure|azure-functions-pack|
|Azure|azure-functions-powershell-worker|
|Azure|azure-functions-python-library|
|Azure|azure-functions-python-worker|
|Azure|azure-functions-rabbitmq-extension|
|Azure|azure-functions-servicebus-extension|
|Azure|azure-functions-signalrservice-extension|
|Azure|azure-functions-templates|
|Azure|azure-functions-tooling-feed|
|Azure|azure-functions-ux|
|Azure|azure-functions-vs-build-sdk|
|Azure|azure-webjobs-sdk|
|Azure|azure-webjobs-sdk-extensions|
|Azure|functions-action|
|Azure|functions-container-action|
|Azure|homebrew-functions|
|marcduiker|az-func-updates|
|microsoft|vscode-azurefunctions|

## RSS Feeds
| Owner | Feed |
|-|-|
|Azure|[Azure Service Updates](https://azurecomcdn.azureedge.net/en-us/updates/feed/?product=functions)|
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AutoFixture" Version="4.8.0" />
<PackageReference Include="FluentAssertions" Version="5.6.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.0-preview-20190203-03" />
<PackageReference Include="Moq" Version="4.10.1" />
<PackageReference Include="AutoFixture" Version="4.11.0" />
<PackageReference Include="FluentAssertions" Version="5.10.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Include="Moq" Version="4.14.1" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
using AzureFunctionsUpdates.Builders;
using AzureFunctionsUpdates.Models.RepositoryReleases;
using AzureFunctionsUpdates.UnitTests.TestObjectBuilders;
using FluentAssertions;
using Xunit;

namespace AzureFunctionsUpdates.UnitTests.Builders
{
public class MessageBuilderTests
{
[Fact]
public void GivenMessageContentIsTooLong_WhenUpdateMessageIsCreated_ThenTheMessageIsShortened()
{
// Arrange
var release = RepositoryReleaseBuilder.BuildOneWithLongRepoAndReleaseName<GitHubRepositoryRelease>();

// Act
var message = MessageBuilder.BuildForRelease(release);

// Assert
var messageLengthWithoutUrlPlusFixedShortenedUrl =
message.Content.Length - release.HtmlUrl.Length + MessageBuilder.TwitterShortenedUrlCharacterCount;
messageLengthWithoutUrlPlusFixedShortenedUrl.Should().BeLessOrEqualTo(MessageBuilder.MaxTwitterCharacterCount);
}

[Fact]
public void GivenMessageContentIsNotTooLong_WhenUpdateMessageIsCreated_ThenTheMessageIsNotShortened()
{
// Arrange
var release = RepositoryReleaseBuilder.BuildOneWithShortRepoAndReleaseNameOnAspecificDate<GitHubRepositoryRelease>();

// Act
var message = MessageBuilder.BuildForRelease(release);

// Assert
var messageLengthWithoutUrlPlusFixedShortenedUrl =
message.Content.Length - release.HtmlUrl.Length + MessageBuilder.TwitterShortenedUrlCharacterCount;
messageLengthWithoutUrlPlusFixedShortenedUrl.Should().BeLessOrEqualTo(MessageBuilder.MaxTwitterCharacterCount);
}

[Fact]
public void GivenARepositoryRelease_WhenUpdateMessageIsCreated_ThenTheMessageContainsTheCorrespondingReleaseInfo()
{
// Arrange
var release = RepositoryReleaseBuilder.BuildOneWithShortRepoAndReleaseNameOnAspecificDate<GitHubRepositoryRelease>();

// Act
var message = MessageBuilder.BuildForRelease(release);

// Assert
message.Content.Should().Be(@"A new azure-functions-host release, Azure Functions Runtime 2.0.12477 (tagged v2.0.12477), is available on GitHub since 01 Jan 2018.

See https://github.com/Azure/azure-functions-host/releases/tag/v2.0.12477 for more information.

#AzureFunctions #Serverless");
}
}
}
Loading