Molotov-Ribbentrop was a non-aggression territorial and economic agreement, not an alliance. One that every knowledgeable historian agrees was seen by the signees as temporary (except possibly by Stalin's drunk ass)
It was not an alliance, they were not in the Axis, and any suggestion otherwise is suspect especially in this context.
Shit, the first thing that happened between them after the invasion of Poland was the Winter War where Finland was supplied by Germany and was a hair's breadth and some racism away from joining the Axis itself.