Skip to content

Commit 8d6e925

Browse files
committed
Merge branch 'release/v7.10.0' into 'master'
Update version to 7.10.0 See merge request sdk/sdk!5799
2 parents 075bfce + 09e5ff3 commit 8d6e925

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+2239
-584
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import os
2+
from jira import JIRA, Issue
3+
from jira.client import ResultList
4+
from slack_sdk import WebClient
5+
from slack_sdk.errors import SlackApiError
6+
7+
# Jira configuration
8+
JIRA_URL = "https://jira.developers.mega.co.nz"
9+
JIRA_API_TOKEN = os.environ["JIRA_PERSONAL_ACCESS_TOKEN"]
10+
JIRA_PROJECTS = ["SDK", "CHT"]
11+
12+
# Slack configuration
13+
SLACK_TOKEN = os.environ["SLACK_BOT_TOKEN"]
14+
SLACK_CHANNEL = "#test-slack-automation"
15+
16+
# Initialize Jira client
17+
jira_client = JIRA(JIRA_URL, token_auth=JIRA_API_TOKEN)
18+
19+
# Initialize Slack client
20+
slack_client = WebClient(token=SLACK_TOKEN)
21+
22+
23+
def fetch_jira_issues(project_key: str) -> ResultList[Issue]:
24+
jql_query = f"project = {project_key} AND status = Resolved AND resolution = Done AND fixVersion is EMPTY"
25+
issues = jira_client.search_issues(
26+
jql_query,
27+
fields="key, assignee",
28+
maxResults=200,
29+
)
30+
31+
return issues
32+
33+
34+
def get_slack_user_id_by_email(email: str) -> str | None:
35+
try:
36+
response = slack_client.users_lookupByEmail(email=email)
37+
return response["user"]["id"]
38+
except SlackApiError as e:
39+
print(f"Error fetching Slack user ID for {email}: {e.response['error']}")
40+
return None
41+
42+
43+
def post_to_slack(issue_key: str, slack_user_id: str):
44+
if not slack_user_id:
45+
user_mention = "<!channel>"
46+
else:
47+
user_mention = f"<@{slack_user_id}>"
48+
49+
issue_url = f"{JIRA_URL}/browse/{issue_key}"
50+
message = (
51+
f"<{issue_url}|{issue_key}> is marked as *Resolved* but is missing a *Fix Version*.\n"
52+
f"CC: {user_mention}"
53+
)
54+
55+
slack_client.chat_postMessage(channel=SLACK_CHANNEL, text=message)
56+
print(message)
57+
58+
59+
for project in JIRA_PROJECTS:
60+
issues = fetch_jira_issues(project)
61+
for issue in issues:
62+
issue_key = issue.key
63+
assignee = issue.fields.assignee
64+
slack_user_id = (
65+
get_slack_user_id_by_email(assignee.emailAddress) if assignee else None
66+
)
67+
post_to_slack(issue_key, slack_user_id)

bindings/ios/MEGABanner.mm

-4
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@ - (void)dealloc {
4949
}
5050
}
5151

52-
- (instancetype)clone {
53-
return self.megaBanner ? [[MEGABanner alloc] initWithMegaBanner:self.megaBanner->copy() cMemoryOwn:YES] : nil;
54-
}
55-
5652
- (MegaBanner *)getCPtr {
5753
return self.megaBanner;
5854
}

bindings/ios/MEGAContactRequestList.mm

-4
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,6 @@ - (void)dealloc {
5050
}
5151
}
5252

53-
- (instancetype)clone {
54-
return self.megaContactRequestList ? [[MEGAContactRequestList alloc] initWithMegaContactRequestList:self.megaContactRequestList->copy() cMemoryOwn:YES] : nil;
55-
}
56-
5753
- (MegaContactRequestList *)getCPtr {
5854
return self.megaContactRequestList;
5955
}

bindings/ios/MEGANode.mm

-4
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,6 @@ - (void)dealloc {
5050
}
5151
}
5252

53-
- (instancetype)clone {
54-
return self.megaNode ? [[MEGANode alloc] initWithMegaNode:self.megaNode->copy() cMemoryOwn:YES] : nil;
55-
}
56-
5753
- (BOOL)isEqual:(id)object {
5854
if (![object isKindOfClass:[MEGANode class]]) {
5955
return false;

bindings/ios/MEGAPushNotificationSettings.mm

-4
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,6 @@ - (void)dealloc {
6666
}
6767
}
6868

69-
- (instancetype)clone {
70-
return self.megaPushNotificationSettings ? [MEGAPushNotificationSettings.alloc initWithMegaPushNotificationSettings:self.megaPushNotificationSettings->copy() cMemoryOwn:YES] : nil;
71-
}
72-
7369
- (MegaPushNotificationSettings *)getCPtr {
7470
return self.megaPushNotificationSettings;
7571
}

bindings/ios/MEGARecentActionBucket.mm

-4
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ - (instancetype)initWithMegaRecentActionBucket:(MegaRecentActionBucket *)megaRec
4747
return self;
4848
}
4949

50-
- (instancetype)clone {
51-
return self.recentActionBucket ? [MEGARecentActionBucket.alloc initWithMegaRecentActionBucket:self.recentActionBucket->copy() cMemoryOwn:YES] : nil;
52-
}
53-
5450
- (MegaRecentActionBucket *)getCPtr {
5551
return self.recentActionBucket;
5652
}

bindings/ios/MEGASdk.mm

-6
Original file line numberDiff line numberDiff line change
@@ -2197,12 +2197,6 @@ - (void)submitPurchase:(MEGAPaymentMethod)gateway receipt:(NSString *)receipt la
21972197
}
21982198
}
21992199

2200-
- (void)creditCardCancelSubscriptions:(nullable NSString *)reason delegate:(id<MEGARequestDelegate>)delegate {
2201-
if (self.megaApi) {
2202-
self.megaApi->creditCardCancelSubscriptions(reason.UTF8String, [self createDelegateMEGARequestListener:delegate singleListener:YES]);
2203-
}
2204-
}
2205-
22062200
- (void)creditCardCancelSubscriptions:(nullable NSString *)reason subscriptionId:(nullable NSString *)subscriptionId canContact:(BOOL)canContact delegate:(id<MEGARequestDelegate>)delegate {
22072201
if (self.megaApi) {
22082202
self.megaApi->creditCardCancelSubscriptions(reason.UTF8String, subscriptionId.UTF8String, canContact, [self createDelegateMEGARequestListener:delegate singleListener:YES queueType:ListenerQueueTypeCurrent]);

bindings/ios/include/MEGANode.h

-13
Original file line numberDiff line numberDiff line change
@@ -320,19 +320,6 @@ NS_ASSUME_NONNULL_BEGIN
320320
*/
321321
@property (readonly, nonatomic, nullable) PasswordNodeData *passwordNodeData;
322322

323-
/**
324-
* @brief Creates a copy of this MEGANode object.
325-
*
326-
* The resulting object is fully independent of the source MEGANode,
327-
* it contains a copy of all internal attributes, so it will be valid after
328-
* the original object is deleted.
329-
*
330-
* You are the owner of the returned object.
331-
*
332-
* @return Copy of the MEGANode object.
333-
*/
334-
- (nullable instancetype)clone;
335-
336323
/**
337324
* @brief Returns a BOOL value that indicates if the node represents a file (type == MEGANodeTypeFile)
338325
* @return YES if the node represents a file, otherwise NO.

bindings/ios/include/MEGARecentActionBucket.h

-13
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,6 @@ NS_ASSUME_NONNULL_BEGIN
3737
*/
3838
@interface MEGARecentActionBucket : NSObject
3939

40-
/**
41-
* @brief Creates a copy of this MEGARecentActionBucket object.
42-
*
43-
* The resulting object is fully independent of the source MEGARecentActionBucket,
44-
* it contains a copy of all internal attributes, so it will be valid after
45-
* the original object is deleted.
46-
*
47-
* You are the owner of the returned object
48-
*
49-
* @return Copy of the MEGARecentActionBucket object
50-
*/
51-
- (instancetype)clone;
52-
5340
/**
5441
* @brief Returns a timestamp reflecting when these changes occurred
5542
*

bindings/ios/include/MEGASdk.h

-9
Original file line numberDiff line numberDiff line change
@@ -5636,15 +5636,6 @@ typedef NS_ENUM(NSInteger, MEGAClientType) {
56365636
*/
56375637
- (void)submitPurchase:(MEGAPaymentMethod)gateway receipt:(NSString *)receipt lastPublicHandle:(uint64_t)lastPublicHandle lastPublicHandleType:(AffiliateType)lastPublicHandleType lastAccessTimestamp:(uint64_t)lastAccessTimestamp;
56385638

5639-
/**
5640-
* @brief Cancel credit card subscriptions of the account
5641-
*
5642-
* The associated request type with this request is MEGARequestTypeCreditCardCancelSubscriptions
5643-
* @param reason Reason for the cancellation.
5644-
* @param delegate MEGARequestDelegate to track this request
5645-
*/
5646-
- (void)creditCardCancelSubscriptions:(nullable NSString *)reason delegate:(id<MEGARequestDelegate>)delegate;
5647-
56485639
/**
56495640
* @brief Cancel credit card subscriptions of the account
56505641
*

bindings/ios/include/MEGASetElement.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ NS_ASSUME_NONNULL_BEGIN
7878
*
7979
* @return timestamp value.
8080
*/
81-
@property (readonly, nonatomic) NSDate *timestamp;
81+
@property (readonly, nonatomic, nullable) NSDate *timestamp;
8282

8383
/**
8484
* @brief Returns name of current Element.

bindings/java/nz/mega/sdk/MegaApiJava.java

+11-17
Original file line numberDiff line numberDiff line change
@@ -5716,26 +5716,20 @@ public void creditCardQuerySubscriptions() {
57165716
}
57175717

57185718
/**
5719-
* Cancel credit card subscriptions of the account
5720-
* <p>
5721-
* The associated request type with this request is MegaRequest::TYPE_CREDIT_CARD_CANCEL_SUBSCRIPTIONS
5719+
* Cancel the credit card subscriptions of the account
57225720
*
5723-
* @param reason Reason for the cancellation. It can be NULL.
5721+
* The associated request type with this request is
5722+
* MegaRequest::TYPE_CREDIT_CARD_CANCEL_SUBSCRIPTIONS
5723+
* @param reason The reason for the cancellation. It can be NULL.
5724+
* @param id The subscription ID for the cancellation. It can be NULL.
5725+
* @param canContact Whether the user has permitted MEGA to contact them for the
5726+
* cancellation.
5727+
* - MegaApi::CREDIT_CARD_CANCEL_SUBSCRIPTIONS_CAN_CONTACT_NO = 0
5728+
* - MegaApi::CREDIT_CARD_CANCEL_SUBSCRIPTIONS_CAN_CONTACT_YES = 1
57245729
* @param listener MegaRequestListener to track this request
57255730
*/
5726-
public void creditCardCancelSubscriptions(String reason, MegaRequestListenerInterface listener) {
5727-
megaApi.creditCardCancelSubscriptions(reason, createDelegateRequestListener(listener));
5728-
}
5729-
5730-
/**
5731-
* Cancel credit card subscriptions of the account
5732-
* <p>
5733-
* The associated request type with this request is MegaRequest::TYPE_CREDIT_CARD_CANCEL_SUBSCRIPTIONS
5734-
*
5735-
* @param reason Reason for the cancellation. It can be NULL.
5736-
*/
5737-
public void creditCardCancelSubscriptions(String reason) {
5738-
megaApi.creditCardCancelSubscriptions(reason);
5731+
public void creditCardCancelSubscriptions(String reason, String id, int canContact, MegaRequestListenerInterface listener) {
5732+
megaApi.creditCardCancelSubscriptions(reason, id, canContact, createDelegateRequestListener(listener));
57395733
}
57405734

57415735
/**

examples/megacli.cpp

+46-12
Original file line numberDiff line numberDiff line change
@@ -451,17 +451,29 @@ void AppFilePut::completed(Transfer* t, putsource_t source)
451451
assert(t->type == PUT);
452452

453453
auto onCompleted_foward = onCompleted;
454-
sendPutnodesOfUpload(t->client, t->uploadhandle, *t->ultoken, t->filekey, source, NodeHandle(),
455-
[onCompleted_foward](const Error& e, targettype_t, vector<NewNode>&, bool targetOverride, int tag){
456-
454+
sendPutnodesOfUpload(
455+
t->client,
456+
t->uploadhandle,
457+
*t->ultoken,
458+
t->filekey,
459+
source,
460+
NodeHandle(),
461+
[onCompleted_foward](const Error& e,
462+
targettype_t,
463+
vector<NewNode>&,
464+
bool targetOverride,
465+
int tag,
466+
const map<string, string>& /*fileHandles*/)
467+
{
457468
if (e)
458469
{
459470
cout << "Putnodes error is breaking upload/download cycle: " << e << endl;
460471
}
461-
else if (onCompleted_foward) onCompleted_foward();
462-
472+
else if (onCompleted_foward)
473+
onCompleted_foward();
463474
},
464-
nullptr, false);
475+
nullptr,
476+
false);
465477

466478
delete this;
467479
}
@@ -1211,7 +1223,12 @@ void DemoApp::fetchnodes_result(const Error& e)
12111223
}
12121224
}
12131225

1214-
void DemoApp::putnodes_result(const Error& e, targettype_t t, vector<NewNode>& nn, bool targetOverride, int tag)
1226+
void DemoApp::putnodes_result(const Error& e,
1227+
targettype_t t,
1228+
vector<NewNode>& nn,
1229+
bool targetOverride,
1230+
int tag,
1231+
const map<string, string>& /*fileHandles*/)
12151232
{
12161233
if (t == USER_HANDLE)
12171234
{
@@ -6006,16 +6023,33 @@ void exec_get(autocomplete::ACState& s)
60066023
{
60076024
cout << "Checking link..." << endl;
60086025

6009-
client->reqs.add(new CommandGetFile(client, key, FILENODEKEYLENGTH, false, ph, false, nullptr, nullptr, nullptr, false,
6010-
[key, ph](const Error &e, m_off_t size, dstime /*timeleft*/,
6011-
std::string* filename, std::string* fingerprint, std::string* fileattrstring,
6012-
const std::vector<std::string> &/*tempurls*/, const std::vector<std::string> &/*ips*/)
6026+
client->reqs.add(new CommandGetFile(
6027+
client,
6028+
key,
6029+
FILENODEKEYLENGTH,
6030+
false,
6031+
ph,
6032+
false,
6033+
nullptr,
6034+
nullptr,
6035+
nullptr,
6036+
false,
6037+
[key, ph](const Error& e,
6038+
m_off_t size,
6039+
dstime /*timeleft*/,
6040+
std::string* filename,
6041+
std::string* fingerprint,
6042+
std::string* fileattrstring,
6043+
const std::vector<std::string>& /*tempurls*/,
6044+
const std::vector<std::string>& /*ips*/,
6045+
const std::string& /*fileHandle*/)
60136046
{
60146047
if (!fingerprint) // failed processing the command
60156048
{
60166049
if (e == API_ETOOMANY && e.hasExtraInfo())
60176050
{
6018-
cout << "Link check failed: " << DemoApp::getExtraInfoErrorString(e) << endl;
6051+
cout << "Link check failed: " << DemoApp::getExtraInfoErrorString(e)
6052+
<< endl;
60196053
}
60206054
else
60216055
{

examples/megacli.h

+6-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,12 @@ struct DemoApp : public MegaApp
178178

179179
void fetchnodes_result(const Error&) override;
180180

181-
void putnodes_result(const Error&, targettype_t, vector<NewNode>&, bool targetOverride, int tag) override;
181+
void putnodes_result(const Error&,
182+
targettype_t,
183+
vector<NewNode>&,
184+
bool targetOverride,
185+
int tag,
186+
const std::map<std::string, std::string>& fileHandles) override;
182187

183188
void setpcr_result(handle, error, opcactions_t) override;
184189
void updatepcr_result(error, ipcactions_t) override;

0 commit comments

Comments
 (0)