Skip to content

Merge user accounts - add web service functionality - #248

Open
nvallinoto wants to merge 17 commits into
jpahullo:wip-ws-tasksfrom
nvallinoto:master
Open

Merge user accounts - add web service functionality#248
nvallinoto wants to merge 17 commits into
jpahullo:wip-ws-tasksfrom
nvallinoto:master

Conversation

@nvallinoto

@nvallinoto nvallinoto commented Jul 6, 2023

Copy link
Copy Markdown

MergeUserAccounts-WebServices - v2 drawio
This PR is a follow up of a previous PR (#242).
It is the development of the issue #218 to implement web service tool for merge users plugin.
In the above image you will find a visual representation of the changes needed to implement the new web service functionality.
The code has been tested only in local environment. It should be checked with behat or phpunit test running the files included in test folder.
In file revisited_file.php are listed the new files (added) and the update files (modified).
The files' code has been checked with code checker plugin. Except for mergeusertool.php that already existed and has names of variables in upper case.
Lot of job is already done and more has to come. Many thanks to Jordi for solving troubles step by step.

Matthias Opitz and others added 7 commits June 19, 2023 13:51
Comment thread classes/external/get_data_merge_requests.php
Comment thread classes/external/get_data_merge_requests.php Outdated
Comment thread classes/external/get_data_merge_requests.php
Comment thread classes/external/get_data_merge_requests.php
Comment thread classes/merge_request.php
Comment thread lang/en/tool_mergeusers.php Outdated
Comment thread lang/en/tool_mergeusers.php Outdated
Comment thread lib/mergeusertool.php Outdated
Comment thread revisited_file.php Outdated
Comment thread version.php
@jpahullo

jpahullo commented Jul 8, 2023

Copy link
Copy Markdown
Owner

Hi @nvallinoto,

I have revisited your new PR. It is mainly what we had last time, hoping this time is cleaner the git history.

I detected some things:

  • Things that I commented on the old PR but that were not addressed, like using a merge_request instance instead of a stdclass instance.
  • New things, related to scenarios that may present infinite loops for the adhoc task due to failing finding some of the users.
  • Other things that, maybe because today I have a fresh mind, I could see today, and not before. Sorry for this.

Would you mind to go on with the work, please, and complete this part?

Thank you a lot for your work.

Jordi

Comment thread classes/task/merge_user_accounts.php Outdated
if ($mergerequestresult->status != merge_request::COMPLETED_WITH_ERRORS &&
$mergerequestresult->status != merge_request::COMPLETED_WITH_SUCCESS) {
// Throwing exception will ensure this adhoc task is re-queued until $maxretries is reached.
throw new moodle_exception(get_string('failedmergerequest', 'tool_mergeusers'));

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also add the current $mergerequest->id and $mergerequest->retries into the message of the exception, into the failedmergerequest string. This way, we provide enough context into the exception message and int he trace log.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't the the parameters ont the get_string() yet.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revisit the API of the constructor of moodle_exception, function __construct($errorcode, $module='', $link='', $a=NULL, $debuginfo=null) {

the instantiation should be something like:

throw new moodle_exception('failedmergerequest', 'tool_mergeusers');

and if this, imagine, has to have some parameters on the string, it should be called like this:

throw new moodle_exception('failedmergerequest', 'tool_mergeusers', '', $a);

Revisit all moodle_exception to be invoked this way.

@jpahullo

Copy link
Copy Markdown
Owner

Hi @nvallinoto,

Try to address most of the proposed changes. If you feel that certain proposed changes are not fully understood, please do not do any change, just in case.

I propose you to make all or most of the proposed changes, update the PR, and let me check it again.

I would run it locally with the merge request log from my production system to check if it behaves properly. We have thousands of merge requests from the old format.

We need to close this PR, this part of the task, to follow on the next steps: review generating merge request from web, review the cli interface, and reformat the web log of requests, to show now the merge requests. This way, only having all these jobs completed, we will be able to release this new feature.

Thanks a lot for your work.

Jordi

Comment thread classes/merge_request.php

@nvallinoto nvallinoto left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have modified and integrated all the requests from the previous commit. I code checked the files and I did a test using the web service to enqueue a merge request, running the task to move the request to adhoc task and executed it.
The log of the merge request is the following:
{"1689252308":["For logging or security reasons we are skipping <strong>my_pages, user_preferences, user_info_data, user_private_key<\/strong>.\n <br \/>To remove these entries, delete the old user once this script has run successfully.","Started merging at gioved\u00ec, 13 luglio 2023, 14:44","UPDATE mdl_user_enrolments SET userid = '24' WHERE id IN (103)","UPDATE mdl_role_assignments SET userid = '24' WHERE id IN (102)","UPDATE mdl_logstore_standard_log SET relateduserid = '24' WHERE id IN (11768, 11769, 11770, 11774, 11775, 11777)","Finished merging at gioved\u00ec, 13 luglio 2023, 14:44","Merge took 0 seconds"],"1689252369":["For logging or security reasons we are skipping <strong>my_pages, user_preferences, user_info_data, user_private_key<\/strong>.\n <br \/>To remove these entries, delete the old user once this script has run successfully.","Started merging at gioved\u00ec, 13 luglio 2023, 14:46","Finished merging at gioved\u00ec, 13 luglio 2023, 14:46","Merge took 1 seconds"]}
Calling the webservice enqueue_merge_request I tried too a case where the keep user returned more than one record. It finished with an error as expected:
{ "exception": "Error", "errorcode": null, "message": "Class \"tool_mergeusers\\external\\Exception\" not found"}

Perhaps there is a way to return an understandable message. In our code we raise an exception like this:

throw new Exception(get_string('toomanyusers', 'tool_mergeusers', (object)['userfield' => $keepuserfield, 'uservalue' => $keepuservalue]));
}`.

@jpahullo

Copy link
Copy Markdown
Owner

Yes, you need to add

use Exception;

at the beginning of the file, or throw it adding a backlslash throw new \Exception(...);

@jpahullo

Copy link
Copy Markdown
Owner

All this "class not found" are mostly similar to this.

I prefer adding use Exception; (or whatever the class is) at the beginning of the file, just in case it is used several times within the file. This way preventing more runtime errors of the same type.

@nvallinoto

Copy link
Copy Markdown
Author

It worked. This is the answer of the web service call:
{
"exception": "Exception",
"errorcode": null,
"message": "More than one user found with email name.surname@gmail.com."
}
I'll push the file

Comment thread .gitignore Outdated
Comment thread classes/external/enqueue_merge_request.php Outdated
Comment thread classes/external/enqueue_merge_request.php Outdated
Comment thread classes/external/enqueue_merge_request.php Outdated
Comment thread classes/external/enqueue_merge_request.php Outdated
Comment thread classes/task/queue_to_process_pending_merge_requests.php Outdated
Comment thread classes/task/queue_to_process_pending_merge_requests.php Outdated
Comment thread lang/en/tool_mergeusers.php Outdated
$string['toomanyusers'] = 'More than one user found with {$a->userfield} {$a->uservalue}.';
$string['maxattempts'] = 'Max number of attempts of a merge request.';
$string['maxattempts_desc'] = 'This is the maximum number of attempts that a merge request will be tried to merge. After that number of attempts without success, the request will not be processed anymore and it will be updated as ended with errors.';
$string['failedmergerequest'] = 'Failed merge request n° {$a->id}. Number of attempts: {$a->retries}';

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not use º, instead use the word, in this case, Failed merge request with id {$a->id}, on the attempt number {$a->retries}..

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You left 2 spaces between reqeust with. Leave just a single space.

Comment thread revisited_file.php Outdated
Comment thread revisited_file.php Outdated
Comment thread classes/merge_request.php Outdated
Comment thread classes/task/merge_user_accounts.php

@nvallinoto nvallinoto left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I committed a new version with all requests you done during the weekend. I codechecked the files. We need to solve and decide how to act in the following cases:

  • merge action for users that need only to update username
  • add a new variable successful retries in merge_requests.php class
    I make some test. Please wait before reviewing again the code.

Comment thread classes/external/enqueue_merge_request.php
Comment thread classes/external/enqueue_merge_request.php
@jpahullo

Copy link
Copy Markdown
Owner

I committed a new version with all requests you done during the weekend. I codechecked the files. We need to solve and decide how to act in the following cases:

  • merge action for users that need only to update username
  • add a new variable successful retries in merge_requests.php class
    I make some test. Please wait before reviewing again the code.

For the merge request processed as an update, it would need to refactor a bit the business logic. Leave this part to the end. If there is availability, analyse the case given the conditions I gave you, in a different commit from the rest.

To add a new variable successful retries, just proceed as you believe. Give yourself a try. You can. Revisit the whole code to consider this new field (datbase field, install.xml, upgrade.php, code, web services). I think it is more important to conclude with this, than the update for username/idnumber/etc.

Thanks a lot!

@nvallinoto

nvallinoto commented Jul 18, 2023

Copy link
Copy Markdown
Author

Actually, mod_quiz\quiz_settings means the expected path is this one: mod/quiz/classes/quiz_settings.php or mod/quiz/classes/settings.php

I have seen inside mod/quiz/classes and don't have both files. What I see are the following files and folders:
admin_review_setting.php adminpresets event local question
admin_setting_browsersecurity.php analytics external navigation repaginate.php
admin_setting_grademethod.php cache external.php output search
admin_setting_overduehandling.php completion form plugininfo structure.php
admin_setting_user_image.php dates.php group_observers.php privacy task

@nvallinoto

nvallinoto commented Jul 18, 2023

Copy link
Copy Markdown
Author

Actually, mod_quiz\quiz_settings means the expected path is this one: mod/quiz/classes/quiz_settings.php or mod/quiz/classes/settings.php

I have the settings.php file inside the folder
mod/quiz

in file quizattemptsmerger.php I have
use mod_quiz\quiz_settings;

@jpahullo

Copy link
Copy Markdown
Owner

mod/quiz/settings.php is not what you are looking for.

It should be another class.

Could you look for this class on Moodle 3.11 or Moodle 3.10, please?

@nvallinoto

Copy link
Copy Markdown
Author

settings.php

now I have Moodle 4.1.4

@nvallinoto

nvallinoto commented Jul 18, 2023

Copy link
Copy Markdown
Author

what is your actual situation (Moodle version and position of quiz_settings.php) ?
I found a quiz_settings.php file here
./mod/quiz/accessrule/seb/classes/quiz_settings.php

@jpahullo

Copy link
Copy Markdown
Owner

I have discovered that this is something specific for Moodle 4.2. So, we have to work on Moodle 4.2 onwards for master branch. Since then, we have to work with the branch MOODLE_310_STABLE or MOODLE_401_STABLE of this plugin, depending on what Moodle version you have. You have to do:

git checkout yourbranch
git remote update --prune
git rebase MOODLE_310_STABLE (or MOODLE_401_STABLE).

So that the version of the stable branch is the lowest Moodle version that this branch gives support to, till the next one (excluded). So that MOODLE_310_STABLE covers M3.10, 3.11, 4.0, and MOODLE_401_STABLE covers only M4.1, since master branch covers M4.2 onwards.

Sorry for the confusion.

@nvallinoto

Copy link
Copy Markdown
Author

since I have Moodle 4.1.4 I need to rebase MOODLE_401_STABLE. right ?

@nvallinoto

Copy link
Copy Markdown
Author

this is what I need to do right ? MOODLE_401_STABLE is a constant ?
git checkout master
git remote update --prune
git rebase MOODLE_401_STABLE

@nvallinoto

Copy link
Copy Markdown
Author

I tried git rebase MOODLE_401_STABLE and received this message:
fatal: invalid upstream 'MOODLE_401_STABLE'

@jpahullo

Copy link
Copy Markdown
Owner

I tried git rebase MOODLE_401_STABLE and received this message: fatal: invalid upstream 'MOODLE_401_STABLE'

Yeah, how are you defining this repo? Supposo you named it like upstream (it's usual to name your repo like origin and then the other main repo like upstream to know where main changes come from and where are you contributing to).

With this assumption you have to do like git rebase upstream/MOODLE_401_STABLE. This has to work. Double check the name of this repo to check if you have to name it as upstream or whatever you have.

git rebase MOODLE_401_STABLE is assuming you did git checkout MOODLE_401_STABLE first, this is why it didn't work.

@nvallinoto

Copy link
Copy Markdown
Author

a local level I have two branches:
master and ws.
I use master to push changes to remote repository https://github.com/nvallinoto/moodle-tool_mergeusers

@jpahullo

Copy link
Copy Markdown
Owner

Mmmmm....

Actually, you are not pointing to master, I realized you're pointing to the custom branch jpahullo:wip-ws-tasks. So, I will rebase it onto MOODLE_401_STABLE and so you should get the whole work operating properly again.

@nvallinoto

Copy link
Copy Markdown
Author

I tried git rebase MOODLE_401_STABLE and received this message: fatal: invalid upstream 'MOODLE_401_STABLE'

Yeah, how are you defining this repo? Supposo you named it like upstream (it's usual to name your repo like origin and then the other main repo like upstream to know where main changes come from and where are you contributing to).

With this assumption you have to do like git rebase upstream/MOODLE_401_STABLE. This has to work. Double check the name of this repo to check if you have to name it as upstream or whatever you have.

git rebase MOODLE_401_STABLE is assuming you did git checkout MOODLE_401_STABLE first, this is why it didn't work.

I did

  • git checkout MOODLE_401_STABLE
    Branch 'MOODLE_401_STABLE' set up to track remote branch 'MOODLE_401_STABLE' from 'origin'.
    Switched to a new branch 'MOODLE_401_STABLE'

  • git rebase MOODLE_401_STABLE
    Current branch MOODLE_401_STABLE is up to date.

and now ?

@nvallinoto

Copy link
Copy Markdown
Author

Mmmmm....

Actually, you are not pointing to master, I realized you're pointing to the custom branch jpahullo:wip-ws-tasks. So, I will rebase it onto MOODLE_401_STABLE and so you should get the whole work operating properly again.

ok tell me what to do after your rebase onto MOODLE_401_STABLE

@jpahullo

Copy link
Copy Markdown
Owner

Updated branch to point to MOODLE_401_STABLE.

I suggest you to remove your local wip-ws-tasks branch, and then put your commits on to that branch (git checkout master; git rebase mua/wip-ws-tasks)

@nvallinoto

nvallinoto commented Jul 18, 2023

Copy link
Copy Markdown
Author

Updated branch to point to MOODLE_401_STABLE.

I suggest you to remove your local wip-ws-tasks branch, and then put your commits on to that branch (git checkout master; git rebase mua/wip-ws-tasks)

I deleted my local wip-ws-task (I removed ws branch). Then I switched to master branch. git status on branch master gave your branch is up to date with mua/master. After that I tried to git rebase mua/wip-ws-task but the answer was fatal: invalid upstream mua/wip-ws-task.

At local level git branch gave:

MOODLE_401_STABLE
* master

While git remote -v gave

mua     https://github.com/nvallinoto/moodle-tool_mergeusers (fetch)
mua     https://github.com/nvallinoto/moodle-tool_mergeusers (push)
origin  https://github.com/jpahullo/moodle-tool_mergeusers.git (fetch)
origin  https://github.com/jpahullo/moodle-tool_mergeusers.git (push)

@jpahullo

Copy link
Copy Markdown
Owner

I have created the branch https://github.com/jpahullo/moodle-tool_mergeusers/tree/nvallinoto-master on this repo that is equivalent to your nvallinoto/master branch, but pointing onto the wip-ws-tasks branch.

To complete this command, I had to run this command: git rebase --onto wip-ws-tasks master nvallinoto-master. Learn about it for you and your learning about git. Like in official git docs

You can use this repo branch with name nvallinoto-master to be your new nvallinoto/master branch.

For you of the future, I recommend you to build a new branch for any single development. I use to use the issue number as the prefix of the branch, like 218-ws for the issue number #218. This way, you leave master branch intact and can be updated from the upstream repository without problem (important!). And you have your work separated by branches. This way, if you have to reprioritize any other work, save your changes into the branch, and change to the other branch (or create a new one) to address the other more important job.

Comment thread classes/task/merge_user_accounts.php Outdated
// Append logs to the list.
// $baseitem->log[$item->timemodified] = json_decode($item->log, false);
$logs[$record->timeadded] = $log;
$this->update_status_and_log_in_table($record->id,

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should add a new method to the merge_request class, like this:

public function get_log_as_json(): string {
    return $this->data->log;
}

And update the __set() method to consider this, by adding this piece of code:

        if ($name == 'status && 
           ($value == merge_request::COMPLETED_WITH_SUCCESS ||
            $value == merge_request::COMPLETED_WITH_ERRORS)) {
                $this->timecompleted = time();
        }

Then, to simplify the operation of the update_status_and_log method, by having this:

private function update_status_and_log(merge_request $mergerequest): void {
    ...
    $update = (object)[
        'id' => $mergerequest->id,
       'status' => $mergerequest->status,
       'timecompleted' => $mergerequest->timecompleted,
      'log' => $mergerequest->get_log_as_json(),
    ];
    $DB->....
}

so we fully delegate on the merge_request class to update any field according to the business logic, internally, and not externally.

Also, the 2 lines have to be in the reverse order:

$mergerequest->status = $status;
$this->update_status_and_log($mergerequest);

So the status is up-to-date when updating it inside the update_status_and_log method.

Comment thread classes/task/merge_user_accounts.php Outdated
$users = $DB->get_records(merge_request::TABLE_USERS, [$userfield => $uservalue]);
if (count($users) == 0) {
throw new moodle_exception(get_string('cannotfinduser', 'tool_mergeusers',
(object)['userfield' => $userfield, 'uservalue' => $uservalue]));

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is still pending

['status' => merge_request::QUEUED_NOT_PROCESSED],
$sort = '',
$fields = 'id');
$conta = 0;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

according to the recordset API, you have to close the recordset at the end, out from the foreach, like $mergerequestsnotyetscheduled->close();

Comment thread classes/task/merge_user_accounts.php Outdated
if ($mergerequestresult->status != merge_request::COMPLETED_WITH_ERRORS &&
$mergerequestresult->status != merge_request::COMPLETED_WITH_SUCCESS) {
// Throwing exception will ensure this adhoc task is re-queued until $maxretries is reached.
throw new moodle_exception(get_string('failedmergerequest', 'tool_mergeusers'));

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revisit the API of the constructor of moodle_exception, function __construct($errorcode, $module='', $link='', $a=NULL, $debuginfo=null) {

the instantiation should be something like:

throw new moodle_exception('failedmergerequest', 'tool_mergeusers');

and if this, imagine, has to have some parameters on the string, it should be called like this:

throw new moodle_exception('failedmergerequest', 'tool_mergeusers', '', $a);

Revisit all moodle_exception to be invoked this way.

Comment thread classes/external/enqueue_merge_request.php Outdated
Comment thread classes/merge_request.php Outdated
*/
public function __get($name) {
if (isset($this->data->{$name})) {
$value = $this->data->{$name};

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is happing something similar yet:

image

check tabulars and characters, only spaces have to exist there.

Comment thread classes/task/merge_user_accounts.php Outdated
}
$mergerequest->append_log($log, time());
if ($mergerequest->retries > $maxattempts) {
$log_attempts = "Reached the number of maximum attempts";

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lines like $log_attempts = get_string('maxattemptsreached', 'tool_mergeusers');

should be like:

$log_attempts = get_string('maxattemptsreached', 'tool_mergeusers', (object)['retries'=>$mergerequest->retries, 'maxretries' => $maxattempts]);

in order to report both numbers in the resulting string. Update the lang file properly too.

I commented this in some other comment, but I cannot find it over here.

]));
}
if (!empty($errorfound)) {
$mergerequest->appendlog([$errorfound], time());

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still pending.

Comment thread lang/en/tool_mergeusers.php Outdated
$string['toomanyusers'] = 'More than one user found with {$a->userfield} {$a->uservalue}.';
$string['maxattempts'] = 'Max number of attempts of a merge request.';
$string['maxattempts_desc'] = 'This is the maximum number of attempts that a merge request will be tried to merge. After that number of attempts without success, the request will not be processed anymore and it will be updated as ended with errors.';
$string['failedmergerequest'] = 'Failed merge request n° {$a->id}. Number of attempts: {$a->retries}';

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You left 2 spaces between reqeust with. Leave just a single space.

@jpahullo

Copy link
Copy Markdown
Owner

I created #250 for the other part of the work, to address it apart from this PR.

@jpahullo

jpahullo commented Jul 20, 2023

Copy link
Copy Markdown
Owner

@nvallinoto, you asked me how to proceed with this PR now.

This is more related to git branch management that anything else. What I recommend you is the following:

Lines with # at the beginning are comments:

git remote rename origin upstream
git remote rename mua origin
# upstream repo is always the remote repo, origin is yours. 
# keep a backup of your work
git checkout master
git branch -m master-old-with-ws
# keep clean local master branch and synced with this repository
git checkout -b master upstream/master
# to replicate in a local branch the work already did and keep what you did, but now onto wip-ws-tasks branch
git checkout -b 218-ws upstream/nvallinoto-master
# now you are on local branch 218-ws, related to the issue #218 created by you regarding web services.
# continue fixing things.
# when having new changes, you can then push your branch as always, and open a new PR, or, I think, you can update the related branch to this PR https://github.com/jpahullo/moodle-tool_mergeusers/pull/248

@nvallinoto

nvallinoto commented Jul 20, 2023

Copy link
Copy Markdown
Author

@nvallinoto, you asked me how to proceed with this PR now.

This is more related to git branch management that anything else. What I recommend you is the following:

Lines with # at the beginning are comments:

# keep a backup of your work
git checkout master
git branch -m master-old-with-ws
# keep clean local master branch and synced with this repository
git checkout -b master mua/master
# to replicate in a local branch the work already did and keep what you did, but now onto wip-ws-tasks branch
git checkout -b 218-ws mua/nvallinoto-master
# now you are on local branch 218-ws, related to the issue #218 created by you regarding web services.
# continue fixing things.
# when having new changes, you can then push your branch as always, and open a new PR, or, I think, you can update the related branch to this PR https://github.com/jpahullo/moodle-tool_mergeusers/pull/248

I did the first step until this one:

git checkout -b 218-ws mua/nvallinoto-master

it gave me an error because I don't have mua/nvallinoto-master but only mua/master

If I exec

  • git remove -v

I obtain this:
mua https://github.com/nvallinoto/moodle-tool_mergeusers (fetch)
mua https://github.com/nvallinoto/moodle-tool_mergeusers (push)
origin https://github.com/jpahullo/moodle-tool_mergeusers.git (fetch)
origin https://github.com/jpahullo/moodle-tool_mergeusers.git (push)

Perhaps I have to add a remote repository with this url ?
https://github.com/jpahullo/moodle-tool_mergeusers/tree/nvallinoto-master
with a command like this ?

thanks

@jpahullo

Copy link
Copy Markdown
Owner

Ok, @nvallinoto

I edited my comment, I was confused about the name of the remotes. So to unify remotes naming, I added two first commands.

It will be essier to interact with you in case of doubts

@nvallinoto

Copy link
Copy Markdown
Author

Ok, @nvallinoto

I edited my comment, I was confused about the name of the remotes. So to unify remotes naming, I added two first commands.

It will be essier to interact with you in case of doubts

so now I have as remote repo:
origin https://github.com/nvallinoto/moodle-tool_mergeusers (fetch)
origin https://github.com/nvallinoto/moodle-tool_mergeusers (push)
upstream https://github.com/jpahullo/moodle-tool_mergeusers.git (fetch)
upstream https://github.com/jpahullo/moodle-tool_mergeusers.git (push)

and now to start in the right way I need to
git checkout -b 218-ws origin ?

@jpahullo

Copy link
Copy Markdown
Owner

I put it in the comment:

git checkout -b 218-ws upstream/nvallinoto-master

this will create a local branch pointing to the remote nvallinoto-master

@nvallinoto

Copy link
Copy Markdown
Author

I put it in the comment:

git checkout -b 218-ws upstream/nvallinoto-master

this will create a local branch pointing to the remote nvallinoto-master

done. now I can start again to update branch on this PR.

@nvallinoto

Copy link
Copy Markdown
Author

I put it in the comment:
git checkout -b 218-ws upstream/nvallinoto-master
this will create a local branch pointing to the remote nvallinoto-master

done. now I can start again to update branch on this PR.

I tried to push upstream/nvallinoto-master but authentication failed

@jpahullo

Copy link
Copy Markdown
Owner

Nops, you cannot push to this repository.

You are working now onto your local branch 218-ws, you have to push it to your repo, and then update this PR with this new branch or create a new PR. We can continue there the revision if necessary.

So, you need to do something like:

git checkout 218-ws
git push --set-upstream origin 218-ws

then, visit this PR and try to update the referenced branches. It it is not possible, create a new PR. It does not matter.

In any case, PR should be between wip-ws-tasks and your 218-ws branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants