Skip to content

Commit

Permalink
RDK-35564: Support Semantic Versioning for RDKServices
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusz-adamski-red authored and anand-ky committed Aug 11, 2022
1 parent 1edb29d commit 955b332
Show file tree
Hide file tree
Showing 171 changed files with 1,845 additions and 205 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ on:
env:
BUILD_TYPE: Debug


# Refs for 2208_sprint.
THUNDER_REF: "331ee30b1eaf82a7e8944ee00b8cb1d1d0aca682"
THUNDER_REF: "02f6ccbca6832043cbc94cc28c1bda7d4954a4e6"
INTERFACES_REF: "cb3b8476aa3b00ae9e73ff0cf64114563d1ee7ae"

THUNDER_BINDING: "127.0.0.1"
Expand Down Expand Up @@ -91,7 +92,7 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true'
run: >
cmake
--build build/ThunderTools
--build build/ThunderTools -j8
- name: Install ThunderTools
if: steps.cache.outputs.cache-hit != 'true'
Expand All @@ -115,7 +116,7 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true'
run: >
cmake
--build build/Thunder
--build build/Thunder -j8
- name: Install Thunder
if: steps.cache.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -144,7 +145,7 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true'
run: >
cmake
--build build/ThunderInterfaces
--build build/ThunderInterfaces -j8
- name: Install ThunderInterfaces
if: steps.cache.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -197,7 +198,7 @@ jobs:
- name: Build rdkservices
run: >
cmake
--build build/rdkservices
--build build/rdkservices -j8
- name: Install rdkservices
run: >
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/update-changelog-and-api-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: update changelog and api version

on:
push:
branches:
- main
- 'release/**'

pull_request:
branches:
- main
- 'release/**'


jobs:
build:
runs-on: ubuntu-latest # windows-latest | macos-latest
name: Check if changelog and api version were updated
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.

- name: Get changed files using defaults
id: changed-files
uses: tj-actions/changed-files@v19

- name: Run step when a CHANGELOG.md didn't change
uses: actions/github-script@v3
if: ${{ !contains(steps.changed-files.outputs.modified_files, 'CHANGELOG.md') }}
with:
script: |
core.setFailed('CHANGELOG.md should be modified')
20 changes: 19 additions & 1 deletion AVInput/AVInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,25 @@
#include "UtilsJsonRpc.h"
#include "UtilsIarm.h"

#define API_VERSION_NUMBER_MAJOR 1
#define API_VERSION_NUMBER_MINOR 0
#define API_VERSION_NUMBER_PATCH 0

namespace WPEFramework {
namespace {

static Plugin::Metadata<Plugin::AVInput> metadata(
// Version (Major, Minor, Patch)
API_VERSION_NUMBER_MAJOR, API_VERSION_NUMBER_MINOR, API_VERSION_NUMBER_PATCH,
// Preconditions
{},
// Terminations
{},
// Controls
{}
);
}

namespace Plugin {

namespace {
Expand Down Expand Up @@ -53,7 +71,7 @@ void dsHdmiEventHandler(const char *, IARM_EventId_t eventId, void *, size_t)
}
}

SERVICE_REGISTRATION(AVInput, 1, 0);
SERVICE_REGISTRATION(AVInput, API_VERSION_NUMBER_MAJOR, API_VERSION_NUMBER_MINOR, API_VERSION_NUMBER_PATCH);

AVInput* AVInput::_instance = nullptr;

Expand Down
3 changes: 1 addition & 2 deletions AVInput/AVInputPlugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
"callsign": "org.rdk.AVInput",
"locator": "libWPEFrameworkAVInput.so",
"status": "production",
"description": "The `AVInput` plugin facilitates interactions with the Parker STB HDMI input. The HDMI input is presented by using a `VideoResource` whose URL starts with `avin:`. For example: `avin://input1`.",
"version": "1.0"
"description": "The `AVInput` plugin facilitates interactions with the Parker STB HDMI input. The HDMI input is presented by using a `VideoResource` whose URL starts with `avin:`. For example: `avin://input1`."
},
"interface": {
"$ref": "AVInput.json#"
Expand Down
14 changes: 14 additions & 0 deletions AVInput/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.0] - 2022-05-11
### Added
- Add CHANGELOG

### Change
- Reset API version to 1.0.0
- Change README to inform how to update changelog and API version
20 changes: 19 additions & 1 deletion ActivityMonitor/ActivityMonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,29 @@

#define CALLSIGN_PARAMETER "-C"

#define API_VERSION_NUMBER_MAJOR 1
#define API_VERSION_NUMBER_MINOR 0
#define API_VERSION_NUMBER_PATCH 0

namespace WPEFramework
{
namespace {

static Plugin::Metadata<Plugin::ActivityMonitor> metadata(
// Version (Major, Minor, Patch)
API_VERSION_NUMBER_MAJOR, API_VERSION_NUMBER_MINOR, API_VERSION_NUMBER_PATCH,
// Preconditions
{},
// Terminations
{},
// Controls
{}
);
}

namespace Plugin
{
SERVICE_REGISTRATION(ActivityMonitor, 1, 0);
SERVICE_REGISTRATION(ActivityMonitor, API_VERSION_NUMBER_MAJOR, API_VERSION_NUMBER_MINOR, API_VERSION_NUMBER_PATCH);

ActivityMonitor* ActivityMonitor::_instance = nullptr;

Expand Down
3 changes: 1 addition & 2 deletions ActivityMonitor/ActivityMonitorPlugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
"callsign": "org.rdk.ActivityMonitor",
"locator": "libWPEFrameworkActivityMonitor.so",
"status": "production",
"description": "The `ActivityMonitor` plugin allows you to monitor memory and CPU usage by application.",
"version": "1.0"
"description": "The `ActivityMonitor` plugin allows you to monitor memory and CPU usage by application."
},
"interface": {
"$ref": "ActivityMonitor.json#"
Expand Down
14 changes: 14 additions & 0 deletions ActivityMonitor/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.0] - 2022-05-11
### Added
- Add CHANGELOG

### Change
- Reset API version to 1.0.0
- Change README to inform how to update changelog and API version
22 changes: 19 additions & 3 deletions Bluetooth/Bluetooth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@
// For example, the exposed "startScan" method is mapped to "startScanWrapper()" and that one calls to "startDeviceDiscovery()" internally,
// which finally calls to "BTRMGR_StartDeviceDiscovery()" in Bluetooth Manager.

const short WPEFramework::Plugin::Bluetooth::API_VERSION_NUMBER_MAJOR = 1; // corresponds to org.rdk.Bluetooth_5
const short WPEFramework::Plugin::Bluetooth::API_VERSION_NUMBER_MINOR = 0;
#define API_VERSION_NUMBER_MAJOR 1
#define API_VERSION_NUMBER_MINOR 0
#define API_VERSION_NUMBER_PATCH 0

const string WPEFramework::Plugin::Bluetooth::SERVICE_NAME = "org.rdk.Bluetooth";
const string WPEFramework::Plugin::Bluetooth::METHOD_START_SCAN = "startScan";
const string WPEFramework::Plugin::Bluetooth::METHOD_STOP_SCAN = "stopScan";
Expand Down Expand Up @@ -118,9 +120,23 @@ const string WPEFramework::Plugin::Bluetooth::CMD_AUDIO_CTRL_UNMUTE = "AUDIO_UNM

namespace WPEFramework
{
namespace {

static Plugin::Metadata<Plugin::Bluetooth> metadata(
// Version (Major, Minor, Patch)
API_VERSION_NUMBER_MAJOR, API_VERSION_NUMBER_MINOR, API_VERSION_NUMBER_PATCH,
// Preconditions
{},
// Terminations
{},
// Controls
{}
);
}

namespace Plugin
{
SERVICE_REGISTRATION(Bluetooth, Bluetooth::API_VERSION_NUMBER_MAJOR, Bluetooth::API_VERSION_NUMBER_MINOR);
SERVICE_REGISTRATION(Bluetooth, API_VERSION_NUMBER_MAJOR, API_VERSION_NUMBER_MINOR, API_VERSION_NUMBER_PATCH);

Bluetooth* Bluetooth::_instance = nullptr;
static Core::TimerType<DiscoveryTimer> _discoveryTimer(64 * 1024, "DiscoveryTimer");
Expand Down
2 changes: 0 additions & 2 deletions Bluetooth/Bluetooth.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,6 @@ namespace WPEFramework {


public:
static const short API_VERSION_NUMBER_MAJOR;
static const short API_VERSION_NUMBER_MINOR;
static const string SERVICE_NAME;
static const string METHOD_START_SCAN;
static const string METHOD_STOP_SCAN;
Expand Down
3 changes: 1 addition & 2 deletions Bluetooth/BluetoothPlugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
"callsign": "org.rdk.Bluetooth",
"locator": "libWPEFrameworkBluetooth.so",
"status": "production",
"description": "The Bluetooth Plugin allows applications to interact with the Bluetooth stack and manage Bluetooth devices.",
"version": "2.0"
"description": "The Bluetooth Plugin allows applications to interact with the Bluetooth stack and manage Bluetooth devices."
},
"interface": {
"$ref": "Bluetooth.json#"
Expand Down
14 changes: 14 additions & 0 deletions Bluetooth/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.0] - 2022-05-11
### Added
- Add CHANGELOG

### Change
- Reset API version to 1.0.0
- Change README to inform how to update changelog and API version
14 changes: 14 additions & 0 deletions CompositeInput/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.0] - 2022-05-11
### Added
- Add CHANGELOG

### Change
- Reset API version to 1.0.0
- Change README to inform how to update changelog and API version
20 changes: 19 additions & 1 deletion CompositeInput/CompositeInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
#include "dsError.h"
#include "dsMgr.h"

#define API_VERSION_NUMBER_MAJOR 1
#define API_VERSION_NUMBER_MINOR 0
#define API_VERSION_NUMBER_PATCH 0

#define COMPOSITE_HOT_PLUG_EVENT_CONNECTED 1
#define COMPOSITE_HOT_PLUG_EVENT_DISCONNECTED 0

Expand All @@ -41,9 +45,23 @@

namespace WPEFramework
{
namespace {

static Plugin::Metadata<Plugin::CompositeInput> metadata(
// Version (Major, Minor, Patch)
API_VERSION_NUMBER_MAJOR, API_VERSION_NUMBER_MINOR, API_VERSION_NUMBER_PATCH,
// Preconditions
{},
// Terminations
{},
// Controls
{}
);
}

namespace Plugin
{
SERVICE_REGISTRATION(CompositeInput, 1, 0);
SERVICE_REGISTRATION(CompositeInput, API_VERSION_NUMBER_MAJOR, API_VERSION_NUMBER_MINOR, API_VERSION_NUMBER_PATCH);

CompositeInput* CompositeInput::_instance = nullptr;

Expand Down
3 changes: 1 addition & 2 deletions CompositeInput/CompositeInputPlugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
"callsign": "org.rdk.CompositeInput",
"locator": "libWPEFrameworkCompositeInput.so",
"status": "production",
"description": "The `CompositeInput` Plugin allows you to control the composite input source on a device",
"version": "2.0"
"description": "The `CompositeInput` Plugin allows you to control the composite input source on a device"
},
"interface": {
"$ref": "CompositeInput.json#"
Expand Down
14 changes: 14 additions & 0 deletions ContinueWatching/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.0] - 2022-05-11
### Added
- Add CHANGELOG

### Change
- Reset API version to 1.0.0
- Change README to inform how to update changelog and API version
21 changes: 18 additions & 3 deletions ContinueWatching/ContinueWatching.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,33 @@
#define CW_TR181_PARAMETER "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.OTT_Token.Enable"
#define CW_ENV_PARAMETER "ENABLE_OTT_TOKEN"

#define CONTINUEWATCHING_MAJOR_VERSION 1
#define CONTINUEWATCHING_MINOR_VERSION 0
#define API_VERSION_NUMBER_MAJOR 1
#define API_VERSION_NUMBER_MINOR 0
#define API_VERSION_NUMBER_PATCH 0


namespace WPEFramework {

namespace {

static Plugin::Metadata<Plugin::ContinueWatching> metadata(
// Version (Major, Minor, Patch)
API_VERSION_NUMBER_MAJOR, API_VERSION_NUMBER_MINOR, API_VERSION_NUMBER_PATCH,
// Preconditions
{},
// Terminations
{},
// Controls
{}
);
}

namespace Plugin {

/*
*Register ContinueWatching module as wpeframework plugin
**/
SERVICE_REGISTRATION(ContinueWatching, CONTINUEWATCHING_MAJOR_VERSION, CONTINUEWATCHING_MINOR_VERSION);
SERVICE_REGISTRATION(ContinueWatching, API_VERSION_NUMBER_MAJOR, API_VERSION_NUMBER_MINOR, API_VERSION_NUMBER_PATCH);

ContinueWatching* ContinueWatching::_instance = nullptr;

Expand Down
3 changes: 1 addition & 2 deletions ContinueWatching/ContinueWatchingPlugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
"callsign": "org.rdk.ContinueWatching",
"locator": "libWPEFrameworkContinueWatching.so",
"status": "production",
"description": "Initial version of the `ContinueWatching` API.",
"version": "1.0"
"description": "Initial version of the `ContinueWatching` API."
},
"interface": {
"$ref": "ContinueWatching.json#"
Expand Down
Loading

0 comments on commit 955b332

Please sign in to comment.