Skip to content

Commit

Permalink
Merge branch 'release/v7.10.0' into 'master'
Browse files Browse the repository at this point in the history
Update version to 7.10.0

See merge request sdk/sdk!5799
  • Loading branch information
adlonMEGA committed Sep 12, 2024
2 parents 075bfce + 09e5ff3 commit 8d6e925
Show file tree
Hide file tree
Showing 47 changed files with 2,239 additions and 584 deletions.
67 changes: 67 additions & 0 deletions automation/report_tickets_missing_fix_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import os
from jira import JIRA, Issue
from jira.client import ResultList
from slack_sdk import WebClient
from slack_sdk.errors import SlackApiError

# Jira configuration
JIRA_URL = "https://jira.developers.mega.co.nz"
JIRA_API_TOKEN = os.environ["JIRA_PERSONAL_ACCESS_TOKEN"]
JIRA_PROJECTS = ["SDK", "CHT"]

# Slack configuration
SLACK_TOKEN = os.environ["SLACK_BOT_TOKEN"]
SLACK_CHANNEL = "#test-slack-automation"

# Initialize Jira client
jira_client = JIRA(JIRA_URL, token_auth=JIRA_API_TOKEN)

# Initialize Slack client
slack_client = WebClient(token=SLACK_TOKEN)


def fetch_jira_issues(project_key: str) -> ResultList[Issue]:
jql_query = f"project = {project_key} AND status = Resolved AND resolution = Done AND fixVersion is EMPTY"
issues = jira_client.search_issues(
jql_query,
fields="key, assignee",
maxResults=200,
)

return issues


def get_slack_user_id_by_email(email: str) -> str | None:
try:
response = slack_client.users_lookupByEmail(email=email)
return response["user"]["id"]
except SlackApiError as e:
print(f"Error fetching Slack user ID for {email}: {e.response['error']}")
return None


def post_to_slack(issue_key: str, slack_user_id: str):
if not slack_user_id:
user_mention = "<!channel>"
else:
user_mention = f"<@{slack_user_id}>"

issue_url = f"{JIRA_URL}/browse/{issue_key}"
message = (
f"<{issue_url}|{issue_key}> is marked as *Resolved* but is missing a *Fix Version*.\n"
f"CC: {user_mention}"
)

slack_client.chat_postMessage(channel=SLACK_CHANNEL, text=message)
print(message)


for project in JIRA_PROJECTS:
issues = fetch_jira_issues(project)
for issue in issues:
issue_key = issue.key
assignee = issue.fields.assignee
slack_user_id = (
get_slack_user_id_by_email(assignee.emailAddress) if assignee else None
)
post_to_slack(issue_key, slack_user_id)
4 changes: 0 additions & 4 deletions bindings/ios/MEGABanner.mm
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ - (void)dealloc {
}
}

- (instancetype)clone {
return self.megaBanner ? [[MEGABanner alloc] initWithMegaBanner:self.megaBanner->copy() cMemoryOwn:YES] : nil;
}

- (MegaBanner *)getCPtr {
return self.megaBanner;
}
Expand Down
4 changes: 0 additions & 4 deletions bindings/ios/MEGAContactRequestList.mm
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ - (void)dealloc {
}
}

- (instancetype)clone {
return self.megaContactRequestList ? [[MEGAContactRequestList alloc] initWithMegaContactRequestList:self.megaContactRequestList->copy() cMemoryOwn:YES] : nil;
}

- (MegaContactRequestList *)getCPtr {
return self.megaContactRequestList;
}
Expand Down
4 changes: 0 additions & 4 deletions bindings/ios/MEGANode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ - (void)dealloc {
}
}

- (instancetype)clone {
return self.megaNode ? [[MEGANode alloc] initWithMegaNode:self.megaNode->copy() cMemoryOwn:YES] : nil;
}

- (BOOL)isEqual:(id)object {
if (![object isKindOfClass:[MEGANode class]]) {
return false;
Expand Down
4 changes: 0 additions & 4 deletions bindings/ios/MEGAPushNotificationSettings.mm
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ - (void)dealloc {
}
}

- (instancetype)clone {
return self.megaPushNotificationSettings ? [MEGAPushNotificationSettings.alloc initWithMegaPushNotificationSettings:self.megaPushNotificationSettings->copy() cMemoryOwn:YES] : nil;
}

- (MegaPushNotificationSettings *)getCPtr {
return self.megaPushNotificationSettings;
}
Expand Down
4 changes: 0 additions & 4 deletions bindings/ios/MEGARecentActionBucket.mm
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ - (instancetype)initWithMegaRecentActionBucket:(MegaRecentActionBucket *)megaRec
return self;
}

- (instancetype)clone {
return self.recentActionBucket ? [MEGARecentActionBucket.alloc initWithMegaRecentActionBucket:self.recentActionBucket->copy() cMemoryOwn:YES] : nil;
}

- (MegaRecentActionBucket *)getCPtr {
return self.recentActionBucket;
}
Expand Down
6 changes: 0 additions & 6 deletions bindings/ios/MEGASdk.mm
Original file line number Diff line number Diff line change
Expand Up @@ -2197,12 +2197,6 @@ - (void)submitPurchase:(MEGAPaymentMethod)gateway receipt:(NSString *)receipt la
}
}

- (void)creditCardCancelSubscriptions:(nullable NSString *)reason delegate:(id<MEGARequestDelegate>)delegate {
if (self.megaApi) {
self.megaApi->creditCardCancelSubscriptions(reason.UTF8String, [self createDelegateMEGARequestListener:delegate singleListener:YES]);
}
}

- (void)creditCardCancelSubscriptions:(nullable NSString *)reason subscriptionId:(nullable NSString *)subscriptionId canContact:(BOOL)canContact delegate:(id<MEGARequestDelegate>)delegate {
if (self.megaApi) {
self.megaApi->creditCardCancelSubscriptions(reason.UTF8String, subscriptionId.UTF8String, canContact, [self createDelegateMEGARequestListener:delegate singleListener:YES queueType:ListenerQueueTypeCurrent]);
Expand Down
13 changes: 0 additions & 13 deletions bindings/ios/include/MEGANode.h
Original file line number Diff line number Diff line change
Expand Up @@ -320,19 +320,6 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (readonly, nonatomic, nullable) PasswordNodeData *passwordNodeData;

/**
* @brief Creates a copy of this MEGANode object.
*
* The resulting object is fully independent of the source MEGANode,
* it contains a copy of all internal attributes, so it will be valid after
* the original object is deleted.
*
* You are the owner of the returned object.
*
* @return Copy of the MEGANode object.
*/
- (nullable instancetype)clone;

/**
* @brief Returns a BOOL value that indicates if the node represents a file (type == MEGANodeTypeFile)
* @return YES if the node represents a file, otherwise NO.
Expand Down
13 changes: 0 additions & 13 deletions bindings/ios/include/MEGARecentActionBucket.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,6 @@ NS_ASSUME_NONNULL_BEGIN
*/
@interface MEGARecentActionBucket : NSObject

/**
* @brief Creates a copy of this MEGARecentActionBucket object.
*
* The resulting object is fully independent of the source MEGARecentActionBucket,
* it contains a copy of all internal attributes, so it will be valid after
* the original object is deleted.
*
* You are the owner of the returned object
*
* @return Copy of the MEGARecentActionBucket object
*/
- (instancetype)clone;

/**
* @brief Returns a timestamp reflecting when these changes occurred
*
Expand Down
9 changes: 0 additions & 9 deletions bindings/ios/include/MEGASdk.h
Original file line number Diff line number Diff line change
Expand Up @@ -5636,15 +5636,6 @@ typedef NS_ENUM(NSInteger, MEGAClientType) {
*/
- (void)submitPurchase:(MEGAPaymentMethod)gateway receipt:(NSString *)receipt lastPublicHandle:(uint64_t)lastPublicHandle lastPublicHandleType:(AffiliateType)lastPublicHandleType lastAccessTimestamp:(uint64_t)lastAccessTimestamp;

/**
* @brief Cancel credit card subscriptions of the account
*
* The associated request type with this request is MEGARequestTypeCreditCardCancelSubscriptions
* @param reason Reason for the cancellation.
* @param delegate MEGARequestDelegate to track this request
*/
- (void)creditCardCancelSubscriptions:(nullable NSString *)reason delegate:(id<MEGARequestDelegate>)delegate;

/**
* @brief Cancel credit card subscriptions of the account
*
Expand Down
2 changes: 1 addition & 1 deletion bindings/ios/include/MEGASetElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ NS_ASSUME_NONNULL_BEGIN
*
* @return timestamp value.
*/
@property (readonly, nonatomic) NSDate *timestamp;
@property (readonly, nonatomic, nullable) NSDate *timestamp;

/**
* @brief Returns name of current Element.
Expand Down
28 changes: 11 additions & 17 deletions bindings/java/nz/mega/sdk/MegaApiJava.java
Original file line number Diff line number Diff line change
Expand Up @@ -5716,26 +5716,20 @@ public void creditCardQuerySubscriptions() {
}

/**
* Cancel credit card subscriptions of the account
* <p>
* The associated request type with this request is MegaRequest::TYPE_CREDIT_CARD_CANCEL_SUBSCRIPTIONS
* Cancel the credit card subscriptions of the account
*
* @param reason Reason for the cancellation. It can be NULL.
* The associated request type with this request is
* MegaRequest::TYPE_CREDIT_CARD_CANCEL_SUBSCRIPTIONS
* @param reason The reason for the cancellation. It can be NULL.
* @param id The subscription ID for the cancellation. It can be NULL.
* @param canContact Whether the user has permitted MEGA to contact them for the
* cancellation.
* - MegaApi::CREDIT_CARD_CANCEL_SUBSCRIPTIONS_CAN_CONTACT_NO = 0
* - MegaApi::CREDIT_CARD_CANCEL_SUBSCRIPTIONS_CAN_CONTACT_YES = 1
* @param listener MegaRequestListener to track this request
*/
public void creditCardCancelSubscriptions(String reason, MegaRequestListenerInterface listener) {
megaApi.creditCardCancelSubscriptions(reason, createDelegateRequestListener(listener));
}

/**
* Cancel credit card subscriptions of the account
* <p>
* The associated request type with this request is MegaRequest::TYPE_CREDIT_CARD_CANCEL_SUBSCRIPTIONS
*
* @param reason Reason for the cancellation. It can be NULL.
*/
public void creditCardCancelSubscriptions(String reason) {
megaApi.creditCardCancelSubscriptions(reason);
public void creditCardCancelSubscriptions(String reason, String id, int canContact, MegaRequestListenerInterface listener) {
megaApi.creditCardCancelSubscriptions(reason, id, canContact, createDelegateRequestListener(listener));
}

/**
Expand Down
58 changes: 46 additions & 12 deletions examples/megacli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -451,17 +451,29 @@ void AppFilePut::completed(Transfer* t, putsource_t source)
assert(t->type == PUT);

auto onCompleted_foward = onCompleted;
sendPutnodesOfUpload(t->client, t->uploadhandle, *t->ultoken, t->filekey, source, NodeHandle(),
[onCompleted_foward](const Error& e, targettype_t, vector<NewNode>&, bool targetOverride, int tag){

sendPutnodesOfUpload(
t->client,
t->uploadhandle,
*t->ultoken,
t->filekey,
source,
NodeHandle(),
[onCompleted_foward](const Error& e,
targettype_t,
vector<NewNode>&,
bool targetOverride,
int tag,
const map<string, string>& /*fileHandles*/)
{
if (e)
{
cout << "Putnodes error is breaking upload/download cycle: " << e << endl;
}
else if (onCompleted_foward) onCompleted_foward();

else if (onCompleted_foward)
onCompleted_foward();
},
nullptr, false);
nullptr,
false);

delete this;
}
Expand Down Expand Up @@ -1211,7 +1223,12 @@ void DemoApp::fetchnodes_result(const Error& e)
}
}

void DemoApp::putnodes_result(const Error& e, targettype_t t, vector<NewNode>& nn, bool targetOverride, int tag)
void DemoApp::putnodes_result(const Error& e,
targettype_t t,
vector<NewNode>& nn,
bool targetOverride,
int tag,
const map<string, string>& /*fileHandles*/)
{
if (t == USER_HANDLE)
{
Expand Down Expand Up @@ -6006,16 +6023,33 @@ void exec_get(autocomplete::ACState& s)
{
cout << "Checking link..." << endl;

client->reqs.add(new CommandGetFile(client, key, FILENODEKEYLENGTH, false, ph, false, nullptr, nullptr, nullptr, false,
[key, ph](const Error &e, m_off_t size, dstime /*timeleft*/,
std::string* filename, std::string* fingerprint, std::string* fileattrstring,
const std::vector<std::string> &/*tempurls*/, const std::vector<std::string> &/*ips*/)
client->reqs.add(new CommandGetFile(
client,
key,
FILENODEKEYLENGTH,
false,
ph,
false,
nullptr,
nullptr,
nullptr,
false,
[key, ph](const Error& e,
m_off_t size,
dstime /*timeleft*/,
std::string* filename,
std::string* fingerprint,
std::string* fileattrstring,
const std::vector<std::string>& /*tempurls*/,
const std::vector<std::string>& /*ips*/,
const std::string& /*fileHandle*/)
{
if (!fingerprint) // failed processing the command
{
if (e == API_ETOOMANY && e.hasExtraInfo())
{
cout << "Link check failed: " << DemoApp::getExtraInfoErrorString(e) << endl;
cout << "Link check failed: " << DemoApp::getExtraInfoErrorString(e)
<< endl;
}
else
{
Expand Down
7 changes: 6 additions & 1 deletion examples/megacli.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,12 @@ struct DemoApp : public MegaApp

void fetchnodes_result(const Error&) override;

void putnodes_result(const Error&, targettype_t, vector<NewNode>&, bool targetOverride, int tag) override;
void putnodes_result(const Error&,
targettype_t,
vector<NewNode>&,
bool targetOverride,
int tag,
const std::map<std::string, std::string>& fileHandles) override;

void setpcr_result(handle, error, opcactions_t) override;
void updatepcr_result(error, ipcactions_t) override;
Expand Down
Loading

0 comments on commit 8d6e925

Please sign in to comment.