-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add an auto-incremental id to jobs #38
Comments
#Non-job queue elements A feature that will be included in this same issue are the events to initialize / deinitialize (and potentially, create / destroy) queues. Currently, the only command accepted by the actions are:
However, we are going to introduce those new commands:
A queue that is deactivated (not active) will not accept new jobs. Each time a queue is activated, the counter that assigns numbers to jobs is reset. That means that, inside a queue, several jobs can share the same ID, but NOT inside an activate-deactivate span. When the first job of a queue is created, an automatic "queue_name_activated" message is created. Those new events will be marked inside the queue as new messages, with their corresponding commits. The commit messages for those events could be (and is just a proposal): 📝 sample of how a simplified git history (showing only commit messaged) could be: ... About the idsA proposal was made by @da2ce7 to mark the "activated" message with ID 0 (zero). However, as discussed with Jose Celano, this could lead to some UX problems:
This would make the system bigger, more complex and more obscure. Although I understand the concerns of a sequence of IDs beginning from nowhere, I can consider that the user will easily understand that the git activation event is the root of the sequence, without needing to explicitly assign IDs to "queue control events" elements. But of course I may be wrong :) Please @josecelano @da2ce7, let me know your thoughts about this. |
I think some names would be surprising for newcomers:
I would use this new message: 📝 like And the other one: 📝⏸: update_artwork like And I would add an extra message In the ... The workflows should use these actions:
If we want to be more explicit regarding job numbering in the commit subject I would do something like: 📝 If we want to be explicit regarding the last job number after 📝🔄: update_artwork job.secuence.end.42 In general, I do not like resetting the job sequence. If the only reason to allow job sequence reset is to allow reusing the queue name, I would also g solve that problem by using the queue commit hash like the real queue ID instead of the name. As we discussed all jobs could have a metadata field with the queue creation (starting) commit. We could still use the queue name to reference it because we guarantee queues are not nested. Finally, I'm not sure if using commit hashes it's a good idea for both linking job messages and identifying queues. If we "rebase", commit hashes change. We have been pushing directly to the |
Personally I don't think so. I'm not sure that we will find an emoji expressive enough to replace the action name. Actually, I find that also previously defined actions (job create, start and finish) should also have their names (without the "job" word) in the message. They are not redundant because they serve different purposes:
|
I agree: probably resetting the IDs after a queue is deactivated/paused is not intuitive. Also, there are lots of situation in which we want to pause the queue WITHOUT resetting the numbers (e.g. the output being consumed by another system that expects unique IDs in all the queue, not only active-deactive spans). Having the reset effect moved to another action we can solve both scenarios. |
OK, maybe the problem is we are considering the commit subject as both a UI and a state store. If we agree on this @yeraydavidrodriguez and @da2ce7, we should add it to the documentation and be always sure:
|
"OK, maybe the problem is we are considering the commit subject as both a UI and a state store." You are right, this duality is somehow limiting. Maybe we should change our perspective and consider the subject as a UX-only entity, with an user-friendly print of the relevant information, and do the necessary parsing only in the body. |
Hello Yeray and José,
Great Discussion!
1. Merging and Rebasing.
Commits should be merged into the upstream. Keeping the history and signatures intact.
Downstream branches should be rebased upon the upstream.
Rebases should be preformed by the commit author.
2. Rebasing for signing by the author / commitor.
This is a very natural. Often the author would prefer to keep their signing keys on a different environment from their development. Also, many authors may prefer or need to submit patches via email or other out-of-git formats, the commitor should sign them without being the commit author.
3. Rebasing Changes the Commit Hashes.
When using a rebase, the commit id‘s are updated, this should be kept track of, and the corresponding id references should be updated in the child commits.
4. Queue Allocation and Deallocation
A Queue may have multiple staring points, by different authors on different forks, that need to be reconciled before merging.
The simple option is to deallocate all the conflicting queues in their parent branches before merging. Then allocating the queue again post-merge.
When deleting (deallocating) a queue, we first delete any outstanding jobs, then delete the queue.
5. Job Numbers.
When a queue is newly allocated the job number is zero. Meaning there is no jobs for this queue yet.
—
What do you think?
Kind Regards,
Cameron.
… Am 2/5/2022 um 16:44 schrieb yeraydavidrodriguez ***@***.***>:
"OK, maybe the problem is we are considering the commit subject as both a UI and a state store."
You are right, this duality is somehow limiting. Maybe we should change our perspective and consider the subject as a UX-only entity, with an user-friendly print of the relevant information, and do the necessary parsing only in the body.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.
|
@josecelano and @yeraydavidrodriguez some more background for my reasoning. With Git-Queue, the Git Repository is the synchronization authority. I.e. We must not depend on any other external oracle for synchronization. However, Git is a Decentralized Data Structure. So it may be forked at any point, where each fork is extended interdependently. For git, and it's commit histories, the point of resynchronization, is the 'merge', a special commit that can reference one, two, or many branched histories and bring them together. We have to cover the two cases:
We should detect if there is going to be a git-queue merge conflict. To resolve this conflict we have two options.
As a note, if the queue was branched, I don't think that it is elegant to have a 'partly deallocated' queue. We should deallocate all queues that share a common ancestor before merging branches of that queue. We could also decide that it is best to deallocate all the conflicting queues, even if they do not share an ancestor. |
hi @da2ce7
So the final processor would be:
If it's all ok we merge with: git checkout main
git pull
git checkout -b contributor-fork-issue-xxxx-description main
git pull https://github.com/contributor/git-queue.git issue-xxxx-description
git checkout main
merge --ff-only contributor-fork-issue-xxxx-description
git push origin main If there are new commis in the
The commit is signed with the Nautilus bot GPG key and shown as partially verified. With
OK, but we are going to lose the signature anyway unless we merge with
So, I suppose we should provide a new "action" (command) for the action to do that, right?
I understand the problem of having:
But before discussing problems/solutions I need to know what you mean by "allocation" and "deallocation" in terms of the git queue commits.
In terms of implementation, does that mean the action would have these "actions"?:
The first command |
Hi @da2ce7, @yeraydavidrodriguez @ivanramosnet and I have been thinking about your points (1 to 5). We think each of them could have its own discussion but I think we are mixing up some topics. I would suggest re-organizing the discussions into these ones:
In our next meeting, we would like to start discussing point 4, because we think it's a blocker. We could even reconsider whether git-queue makes sense or not. We do not find an easy solution to re-write references from the user's point of view. It forces the user to either:
In more detail we think these are the key points for each discussion: 1. How to merge PR (from contributors).
2. How to merge queue commits with queue messages (from bots). Be aware that we were discussing two solutions but we have only implemented one:
Considering we have implemented option A), our solution is based on:
With option B) we would need:
3. How to upgrade message references to commit hashes after a This is a very complex problem. We see two obvious solutions: A) We do not use commit hashes in the commit subject or body. What else can we use? We do not know, maybe the Job id. But that would make searches slow. 4. Queue Allocation and Deallocation. We think we have to define first the scope and all use cases. You started doing it here, but I would like to specify how that log affects the API. I mean, if the user has to explicitly allocate/deallocate the queues, etcetera. 5. Re-define the queue API (if we add automatically generated jobs). Regarding this topic, we can continue the discussion on the issue because it was related to this WIP issue. If we create those "control jobs" we need to know if those jobs are going to be consumed by the end-user. |
Yesterday we had a meeting (@da2ce7, @ivanramosnet, @yeraydavidrodriguez, @cgbosse, @josecelano ) and we decided:
We were discussing some solutions but before that, we define the types of links we could have in the queue: 1.1 Link queue messages. Some messages reference previous messages. For example, the message Solution: 1.A) @da2ce7 proposed not to use links at all. For example, the Any solution where we do not use commit hashes has a side effect, we need to search for messages in the Git history. We lose the index. If a user wants to search for a git-queue message they need a git-queue command. With solution 1.A) the last job message would contain the whole job history. But if you want to search for the
2.1 You need to create the first queue message in a given branch. There is no previous commit for the new queue. 2.2 The queue already has commits, and the branch where those commits are is going to be merged into another branch.
ConclusionsThere are two big changes:
That led us to think we need to implement a new git-queue concept from the scratch probably as a console command. The console command could have a GitHub Action wrapper in order to make it easier to use the app in a GitHub workflow. Anyway, we knew that at some point it could be useful to extract the git-queue core package into its own NPM package. Next steps
Notes
|
Extract discussion: How to merge PRs created by developers |
Extract discussion: How to keep queue consistence. |
As we defined in this issue we want to give the job an auto-increment id.
Some examples of commit subject using the job id.
We can implement this feature before allowing the queue to have more than one pending job.
The text was updated successfully, but these errors were encountered: